You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Christopher Weiss edited this page Dec 6, 2013
·
3 revisions
To open an existing database you must supply the SQL.open() method with an array of integers where each integer represents a byte of the database file.
The following is a utility function to perform this task:
function bin2Array(bin) {
'use strict';
var i, ary = [];
for (i = 0; i < bin.length; i++) {
ary.push(bin.charCodeAt(i) & 0xFF);
}
return ary;
}
When fetching a database file via XMLHttpRequest you must use overrideMimeType() before send() to set the mime type to 'text/plain; charset=x-user-defined'.