Topic: SimpleViewer Pro <-> jQuery 1.5.1 compatibility

Hi,
I'm developing a website with the latest jquery 1.5.1...
I've noticed that sv-pro uses jquery 1.4.4.
I've included simpleviewer.js AFTER jquery-1.5.1.js (accordingly to http://simpleviewer.net/simpleviewer/su … ml#embed_9) but it seems that jquery 1.5.1 is "replaced" with jquery 1.4.4 because

$().jquery

returns "1.4.4"

How can I use simpleviewer with jquery 1.5.1 ??

Thank you

Re: SimpleViewer Pro <-> jQuery 1.5.1 compatibility

I've included simpleviewer.js AFTER jquery-1.5.1.js

Have you tried placing the jquery-1.5.1.js after the simplevewer.js instead of before. The other option is to open the svcore/js folder and replace the jquery-1.4.4.min.js with the jquery-1.5.1.js, for this to work you would have to rename jquery-1.5.1.js to jquery-1.4.4.min.js.

Mike Richards
SimpleViewer Support Team.

Re: SimpleViewer Pro <-> jQuery 1.5.1 compatibility

I've tried to include jquery1.5.1.js after simpleviewer.js: the jquery loads succesfully (v1.5.1) but I get this error in simpleviewer.js:

b.toLowerCase is not a function
eval(function(p,a,c,k,e,r){e=function(...|touchstart|minimum'.split('|'),0,{}))

But since simpleviewer.js is "packed" I can't even try to get rid of this error.

I've made another try renaming  jquery1.5.1.js into jquery-1.4.4.min.js in the svcore folder... I get a lot of

$ is not a function

It would be great if you can provide a version of simpleviewer.js without (or that will not brake) jQuery 1.5.1.

I have a lot of plugin based on jquery 1.5.1 that will not work with jquery 1.4.4.

Re: SimpleViewer Pro <-> jQuery 1.5.1 compatibility

Ok, haven't tried the new version of jquery with SimpleViewer yet. Until a new version of SimpleViewer is released that supports 1.5.1 you will have to try using the jquery no conflict or something like jQuery-Quarantine


http://forum.jquery.com/topic/multiple- … -same-page

http://blog.nemikor.com/2009/10/03/usin … of-jquery/

Mike Richards
SimpleViewer Support Team.

Re: SimpleViewer Pro <-> jQuery 1.5.1 compatibility

Using noConflict() I may insert jquery1.4.4 in a js variable, let's say "jQuery144"...then simpleviewer.js have to use that variable, NOT "$" or "jQuery"!

// load jquery-1.4.4
<script type="text/javascript" src="svcore/js/jquery-1.4.4.min.js"></script>

// confine jquery1.4.4 into the js variable jQuery144 and delete "$" and "jQuery" from the global scope
<script type="text/javascript"> var jQuery144 = jQuery.noConflict(true);</script>

// load simpleviewer_ jQuery144.js that uses the global js variable jQuery144...NOT "$" or "jQuery"
<script type="text/javascript" src="svcore/js/simpleviewer_ jQuery144.js"></script>

// now load jquery 1.5.1 and the others up-to-date js scripts
<script type="text/javascript" src="js/jquery-1.5.1.min.js"></script>

It is possible to have a version (even packed) of simpleviewer.js (in the above example: simpleviewer_ jQuery144.js) that does not use "$" or "jQuery" but that uses the noConflict variable jQuery144?

Approximatly, when will be released a version of sv compatible with jquery 1.5.*?

Best Regards. Andrea

Re: SimpleViewer Pro <-> jQuery 1.5.1 compatibility

Using noConflict() I may insert jquery1.4.4 in a js variable, let's say "jQuery144"...then simpleviewer.js have to use that variable, NOT "$" or "jQuery"!

Why don't you do this the other way around and load 1.5.1 into a var instead of 1.4.4?

It is possible to have a version (even packed) of simpleviewer.js (in the above example: simpleviewer_ jQuery144.js) that does not use "$" or "jQuery" but that uses the noConflict variable jQuery144?

SimpleViewer already uses jQuery.noConflict(); and does not use $ to reference jquery.

Approximatly, when will be released a version of sv compatible with jquery 1.5.*?

SimpleViewer 2.1.3 is in the works, but I'm not sure if it will support jquery 1.5.1.

Mike Richards
SimpleViewer Support Team.

Re: SimpleViewer Pro <-> jQuery 1.5.1 compatibility

Hi,

can you provide a URL so we can take a look?

Felix Turner
SimpleViewer Support Team.

Re: SimpleViewer Pro <-> jQuery 1.5.1 compatibility

Hi,
I've tried loading SimpleViewer.js before jQuery1.5.1.
When loading, all is ok: no error in simpleviewer.js and, after loading jquery1.5.1, "jQuery().jquery" says "1.5.1" so my plugins and my scripts (loaded after jquery1.5.1) are working with the desired version of jquery (1.5.1).

Since SimpleViewer uses jQuery.noConflict() to "store" jquery 1.4.4 in a private js variable, I think this is the situation now:
- SimpleViewer will use his jQuery 1.4.4 stored somewhere whithout interferencing with jQuery1.5.1
- Other plugins and scripts will refer to  jQuery1.5.1 using the "jQuery" or "$" variable.

But...when I load the gallery with

jQuery(document).ready(function () {
var flashvars = {};
flashvars.galleryURL = 'php/getProductsXML.php?g='+g;
var params = {};
params.allowfullscreen = true;
params.allowscriptaccess = "always";
params.wmode = "transparent";
var attributes = {};
attributes.id = "svInstance";
SV.simpleviewer.load("sv-container", "80%", "100%", "222222", true, flashvars, params, attributes);

})

I get an error on firebug:

b.toLowerCase is not a function
svcore/js/simpleviewer.js/eval/seq/2
Line 1

I have no idea on how I can solve this problem.

I've made a temporary fix loading the gallery in the "old way" with swfobject.js, without including simpleviewer.js (loosing the Universal player and the js API)

var flashvars = {};
flashvars.galleryURL = 'php/getProductsXML.php?g='+g;
flashvars.enableAPI = "true";
var params = {};            
params.allowfullscreen = true;
params.allowscriptaccess = "always";
params.wmode = 'transparent';
swfobject.embedSWF("svcore/swf/simpleviewer.swf", "sv-container", "80%", "100%", "9.0.124", false, flashvars, params);

I need to use the API and I want the Universal Player enabled, so this must be ONLY a temporary solution, waiting for a REAL solution.

Here you can find three examples:

  • Simple Error example : http://www.andreafailli.it/alfa/gallo2/ … =lampadari
    In this example, I load: simpleviewer.js, jquery1.5.1, other plugins/scripts that uses jquery1.5.1. Then I load the gallery using SV.
    I get "b.toLowerCase is not a function" error.

  • A little more intricated example : http://www.andreafailli.it/alfa/gallo/? … =lampadari
    In this example, I load: simpleviewer.js, jquery1.5.1, other plugins/scripts that uses jquery1.5.1. Then the sv-containerDIV and the SV loading script are retrieved via AJAX and inserted into the page.
    I get "b.toLowerCase is not a function" error.

  • Temporary Fix example : http://www.gallosnc.it/?p=slideshow&g=lampadari
    In this example (the real site), I load: jquery1.5.1, other plugins/scripts that uses jquery1.5.1, swfobject.js. Then (via AJAX) i load the gallery using swfobject (loosing the Universal player and the js API features).
    It works fine.

I'm looking forward to hear from you as soon as possible...thank you!!

Andrea Failli

Re: SimpleViewer Pro <-> jQuery 1.5.1 compatibility

Hi,

I'm trying to understand the issue but I got a little confused. What exactly are you trying to do, and what exactly does not work?

thanks.

Felix Turner
SimpleViewer Support Team.

Re: SimpleViewer Pro <-> jQuery 1.5.1 compatibility

Thank you for your interest.
I'm trying to use SimpleViewer in a website that uses jQuery1.5.1.

  • If I load simpleviewer.js AFTER jquery1.5.1, it seems that jquery1.4.4 ("packed" in simpleviewer.js) replace jquery1.5.1. In this case my plugins and scripts designed for jquery1.5.1 are not working.

  • If I load simpleviewer.js BEFORE jquery1.5.1, it seems all OK: jquery1.5.1 replace jquery1.4.4, and simpleviewer.js is loaded without errors. In this case when I load the gallery (in the "standad" way: using the js global object SV) I get the error "b.toLowerCase is not a function"...

When simpleviewer.js is loaded, no other .js file is loaded, so simpleviewer.js may be using "his" version of jquery (and using $.noConflict()?).

Since simpleviewer.js is "packed", I don't know how to investigate about the "b.toLowerCase is not a function" error...

Thank you!

Re: SimpleViewer Pro <-> jQuery 1.5.1 compatibility

had the same issues trying to use SimpleViewer 2.1.2 with jQuery 1.5.1 .. here was my fix:

1) Unpacked simpleviewer.js
2) Removed the load function from adding the reference to jQuery.1.4.4
3) Removed the jQuery.noConflict() from hyjacking the $ (changed to reference jQuery instead)
4) Removed reference to variable $ in initializeSwipe to jq

Doing the above will allow you to FIRST specify the jQuery.1.5.1 library THEN simpleviewer.js

Re: SimpleViewer Pro <-> jQuery 1.5.1 compatibility

Hi,

SimpleViewer 2.1.3 should fix the issue of compatibility with different versions of jQuery. Please download and try v2.1.3. Note that the embed code in v2.1.3 has also changed.

Felix Turner
SimpleViewer Support Team.

Re: SimpleViewer Pro <-> jQuery 1.5.1 compatibility

Hi,
sv2.1.3 is working well with jquery1.5.1 smile (Thank you sv guys!)...but maybe I have some other compatibility issue with some other jquery plugin/script in my website...I get the same error unless I "run" the embed code with a timeout...

setTimeout(function(){

    var flashvars = {};
    flashvars.galleryURL = 'getXML.php';
    var params = {};
    params.wmode = "transparent";
    var attributes = {};
    attributes.id = "svInstance";
    simpleviewer.ready(function () {
        simpleviewer.load("sv-container", "100%", "100%", "222222", true, flashvars, params, attributes);
    });

},1000)

In my website, I include statically jquery, plugins and simpleviewer.js. Then, dinamically I append the div#sv-container to the body and then eval the code above. Maybe there is some delay before the div#sv-container is attached to the body and the embed script have some problem...

Anyway...timer is not a good solution...but it works!

Thank you for your support!!