HTML5 openDatabase not working
In one of my HTML files, I am having a java script function that opens the
database and does some sql operation. Here is my code:
<script>
$(document).ready( function() {
var db = openDatabase('C:\Hari\InDB', '1.0', '', 2 * 1024 *
1024);
db.transaction(function (tx) {
tx.executeSql('SELECT * FROM In', [], function (tx, results){
var len = results.rows.length;
document.getElementById("inp").value = len;
});
});
});
</script>
Here, InDB is my database. My index.html is also placed in C:\Hari. Table
name is In. However, in chrome, I debugged to find if this code is
working. The db.transaction is never getting executed.
I dont know if there is any name given to the database at all.
Please can someone help?
No comments:
Post a Comment