updroid / jquery-jstore

Automatically exported from code.google.com/p/jquery-jstore
1 stars 0 forks source link

jStore will not choose a default engine in Chrome3 and IE7 #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

Use my attached example script.

This example uses the default store and the counter example

The plugin should choose which store to use.

This works fine for me in FF3. 

IE7 or chrome3: It doesn't seem like engine.ready is ever fired.

In addition the DOM storage does not seem to work when script is viewed 
locally. Is this the nature of DOM storage?

Original issue reported on code.google.com by keithhop...@gmail.com on 24 Sep 2009 at 8:15

Attachments:

GoogleCodeExporter commented 9 years ago
DOM storage is not available with file:// urls in chrome due to security 
"issues".
Same with in Firefox. The html5 database works in Safari though.

To get around this serve it off of localhost and you should be fine. 

Original comment by ians...@gmail.com on 25 Sep 2009 at 5:49

GoogleCodeExporter commented 9 years ago
I am having the same problem with chrome, but not IE7. For me IE7 uses "ie" 
storage,
and all is good. 

But for chrome, html5 comes up as a valid Engine, but apparently it is not, 
since
when it tries to initialize the database I get this error: 
JSTORE_ENGINE_HTML5_NODB

I tried putting the FindEngine code in a try/catch, and it seemed to load the 
flash
engine, but my app still did not initialize properly :(

Do you have a workaround for this issue that you can share keith? 

Original comment by ians...@gmail.com on 25 Sep 2009 at 6:14

GoogleCodeExporter commented 9 years ago
Hi iansuda,

I'd say force the Flash engine since this seems to work across all browsers 
(with the 
Flash plugin installed I assume). Make sure your swf is there. I'm just testing 
the 
plugin out but don't have immediate plans for implementing in a project at the 
moment.

Note: Flash implementation will writes to the client's file system and thus 
shares 
the same data between browsers. To avoid this Garside recommends the following:

"simply set the datastore it's using to also contain the name of the browser. 
(So 
normally, if you're working with the datastore "foobar", you could easily make 
it 
read: ("foobar-" + browserName) to keep it separated in each browser.)"

Original comment by keithhop...@gmail.com on 25 Sep 2009 at 6:27

GoogleCodeExporter commented 9 years ago
Hey Keith. 

I fixed chrome by modifying the html5 database initialization code in 
jStore.Html5.js: 

// Set up a static test function for this instance
var avilability = $.jStore.Availability.html5 = function(){
    if(!window.openDatabase)
        return false;
    var db = openDatabase('test', '1.0', "test", 10);
    return !!db
}

This change will cause chrome to choose the proper Engine by default (flash, or 
gears). 

Note this creates a small dummy "test" database in safari, where html5 is a 
valid option.

Original comment by ians...@gmail.com on 25 Sep 2009 at 7:03

GoogleCodeExporter commented 9 years ago
Hey guys, thanks for the patches. I've applied them to the source, and they'll 
be out in the next release. I 
renamed the engine from "test" to "jstore-accessibility-test" to give more of 
an indication as to what the 
database was created for and contains. 

I'm not positive if there's a better workaround, as part of the HTML5 
specification is that the code cannot scan 
the list of databases, or explicitly remove them.

Original comment by gars...@gmail.com on 22 Jan 2010 at 6:26

GoogleCodeExporter commented 9 years ago

Original comment by gars...@gmail.com on 22 Jan 2010 at 6:26

GoogleCodeExporter commented 9 years ago
This issue should be circumvented by jStore 2.0, which should default to local 
storage 
(which if fully chrome supported) by default. The easiest solution is not to 
explictly 
define an engine, but rather a priority list which puts local storage ahead of 
sql storage, 
to force chrome to use local.

Original comment by gars...@gmail.com on 7 Apr 2010 at 5:43

GoogleCodeExporter commented 9 years ago

Original comment by gars...@gmail.com on 7 Apr 2010 at 5:43

GoogleCodeExporter commented 9 years ago
When is jStore 2.0 due?
Have tried applying the workaround mentioned on comment 5 but neither IE7 nor 
Chrom
work. The event doesn't seem to fire. 

Original comment by rami...@gmail.com on 18 May 2010 at 9:37