I dont know if I forget something totally basic here but in my HTML:
<script src="scripts/sql.js" type="text/javascript"></script>
and my js-file looks like this:
var xhr = new XMLHttpRequest();
xhr.open('GET', '123.sqlite3', true);
xhr.responseType = 'arraybuffer';
xhr.onload = function(e) {
var uInt8Array = new Uint8Array(this.response);
db = new SQL.Database(uInt8Array);
};
xhr.send();
function getSearchFromSQL() {
result = db.exec("SELECT * FROM data") ;
document.getElementById('output').innerHTML = result ;
}
As a result i only get
[object Object]
Netbeans tells me that the global variables db and SQL are not declared but I just cant figure out why, since its in the sql.js