Hello, I'm trying to implement the "If you aren't using Browserify, then you can download MemoryStream from https://wzrd.in/standalone/memorystream@latest and it will be available as window.memorystream." scenario.
My function is:
function dump() {
var stream = window.MemoryStream;
db.dump(stream).then(function () {
console.log('Yay, I have a dumpedString: ' + dumpedString);
}).catch(function (err) {
console.log('oh no an error', err);
});
}
I get:
scripts.js:25 Uncaught TypeError: Cannot read property 'on' of undefined
at dump (scripts.js:25)
at HTMLDocument. (scripts.js:17)
at j (jQuery-2.1.4.min.js:2)
at Object.fireWith [as resolveWith] (jQuery-2.1.4.min.js:2)
at Function.ready (jQuery-2.1.4.min.js:2)
at HTMLDocument.I (jQuery-2.1.4.min.js:2)
Hello, I'm trying to implement the "If you aren't using Browserify, then you can download MemoryStream from https://wzrd.in/standalone/memorystream@latest and it will be available as window.memorystream." scenario.
My function is:
function dump() { var stream = window.MemoryStream;
var dumpedString = ''; stream.on('data', function(chunk) { dumpedString += chunk.toString(); });
db.dump(stream).then(function () { console.log('Yay, I have a dumpedString: ' + dumpedString); }).catch(function (err) { console.log('oh no an error', err); }); }
I get:
scripts.js:25 Uncaught TypeError: Cannot read property 'on' of undefined at dump (scripts.js:25) at HTMLDocument. (scripts.js:17)
at j (jQuery-2.1.4.min.js:2)
at Object.fireWith [as resolveWith] (jQuery-2.1.4.min.js:2)
at Function.ready (jQuery-2.1.4.min.js:2)
at HTMLDocument.I (jQuery-2.1.4.min.js:2)
Any ideas?