Last active
July 16, 2019 14:49
-
-
Save waquner/bfa5aa64c53bbd3c158dcbd7421bc010 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<script src="https://cdn.jsdelivr.net/pouchdb/latest/pouchdb.js"></script> | |
<script> | |
// Destroy and recreate the database every time the page is reloaded | |
var db = new PouchDB('testdb'); | |
db.get('blabla.blabla', function(err, doc) { | |
if(doc){ | |
document.getElementById('d').innerHTML = JSON.stringify(doc); | |
} else { | |
db.put({ | |
_id: 'blabla.blabla', | |
value: { | |
test: { | |
test: { | |
test: new Array(10e5).join('x') | |
} | |
} | |
} | |
}, function(err, response) { | |
if (err) { | |
alert(err); | |
} | |
alert(response); | |
}); | |
} | |
}); | |
</script> | |
<div id="d"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment