updroid / jquery-jstore

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

JStore Flash Engine does not work on Safari 5.0 #39

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use JStore on Safari 5.0.

What is the expected output? What do you see instead?

engine.ready callback should be invoked but never is.

What version of the product are you using? On what operating system?

Both stable versions (2.0 & 1.2.0).

Please provide any additional information below.
Unfortunately, JStore 1.2.0 seems to break under Safari 5.0. The
library thinks it supports flash, but the engine.ready callback is
never called. I believe the line of code that is problematic is:

if ($.isFunction($('object', $(doc))[0].f_get_cookie)) this.db =
$('object', $(doc))[0];

This check returns false, so this.db is always undefined. This results
in the engine.ready callback never being invoked. I believe the same
check is used with JStore 2.0, just with different syntax, so it
likely suffers from the same problem.

I did a test where I assigned this.db = $('object', $(doc))[0]; and
everything worked as it should. I guess the condition that is being
checked is somehow different for Safari 5.0.

Original issue reported on code.google.com by wcco...@gmail.com on 5 Jul 2010 at 4:46

GoogleCodeExporter commented 9 years ago
It seems that by backporting the "typecheck" function from 2.0, and calling 
that instead of "isFunction", then it makes it work. I suspect that'll mean it 
works in 2.0.

 // Backported from jstore 2.0, jquery.isFunction doesn't work for native code.
  var typecheck =  function(type, compare) {
    return !type ? false : type.constructor.toString().match(new RegExp(compare + '\\(\\)', 'i')) !== null;
  };

and..

        // Safari
        if (typecheck($('object', $(doc))[0].f_get_cookie, 'function')) this.db = $('object', $(doc))[0];

Original comment by david.sh...@gmail.com on 31 Mar 2011 at 4:51