I started working with Indexed DB for HTML 5 but I am obtaining some strange results. The first one is that I try to clear my database but I only see that it was reset if I refresh the site. Is that how it should be? I have seen other sample codes which it does not happen in this way.
The onsuccess is called but the DB shown, by the update method, is the same that was before...
Here is my reset function:
function resetDB()
{
try
{
if (localDatabase != null && localDatabase.db != null)
{
var store = localDatabase.db.transaction("patients", "readwrite").objectStore("patients");
store.clear().onsuccess = function(event)
{
alert("Patients DB cleared");
update_patients_stored();
};
}
}
catch(e)
{
alert(e);
}
}