0

we are working on a magento site that has jquery loading, version 1.8.2

we have added this

var jlbJs = jQuery.noConflict();

and added this in the page

if (typeof jlbJs != 'undefined') {  
    // jQuery is loaded => print the version
    alert(jlbJs.fn.jquery);
}

just to verify that jquery is available, it also shows the version using jQuery as well.

However once we use

jlbJs(document).ready(function () {
    alert('++++++++++++++++++++++++++');
    jlbJs.reject(); // Default Settings  
    return false;
});

or

jQuery(document).ready(function () {
    alert('++++++++++++++++++++++++++');
    jQuery.reject(); // Default Settings  
    return false;
});

or

jQuery(document).ready(function () {
    alert('++++++++++++++++++++++++++');
});

or any other jquery items in the page it never fires or alerts, no errors, nothing.

anyone have any ideas on what it could be?

jbatson
  • 119
  • 1
  • 14
  • It may be useful to add a bunch of `console.log(jlbJs)` statements in your page (starting at the end of the page). See if it changes. To see the console output it's best to use Chrome or Firefox (with firebug plugin) press F12 to open the developer tools and it should open with the console tab by default. – HMR Nov 16 '13 at 02:28

1 Answers1

0

In my opinion is because of javascript conflict. Try this post: jQuery conflict .The idea is FIRST load the jQuery,then the noConflict script and then the prototype. Hope it helps. Cheers!

Community
  • 1
  • 1
vbak
  • 349
  • 1
  • 7
  • 18
  • The prototype is loaded first then jquery then no conflict right after the jquery load, with magento this has never been a problem and when checking if jlbJs or jQuery is available, it shows that it is. – jbatson Nov 18 '13 at 14:13