Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Jquery conflict – please help!

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #147729
    lprintz
    Participant

    Hello all!

    I’ve exhausted everything here and I’m hoping a fresh set of eyes can help!

    I have a page that has an AJAX loader and a modal but, for whatever reason, I can’t get them BOTH to work! It seems to be the positioning of the jquery library but I’m stumped.

    You’ll notice in the pages below that I simply moved the jquery call from line 20 to 42 to get either one to work.

    http://siphon-marketing.com/test/test-modal.html

    click on the ‘save report’ button at the bottom and you’ll see the modal
    the loading graphic doesn’t appear
    jquery on line 42

    http://siphon-marketing.com/test/test-loading.html

    click on the ‘job title’ in the table to sort and you’ll see the loading gif flash
    the modal doesn’t work
    jquery on line 20

    Thanks SO much…fingers crossed :)

    Len

    #147793
    Chromawoods
    Participant

    On test-modal.html: jQuery is included AFTER a bunch of other jQuery-dependent plugins, which causes a whole bunch of errors. I would start there. Include jQ before the plugins.

    On test-loading.html: The dollar variable ($) is used by some other function and is not used by jQuery, so no jQuery stuff that you do with $ will work there. If you want to use $ instead of using its alias, jQuery, you can achive it quite easily. If all you need is to do stuff at document ready, then replace this:

    $(document).ready(function() {

    …with this: jQuery(document).ready(function($) {

    Now you have passed jQuery to that scope as $ and it will not interfere with that other $ function.

    I don’t know how much control you have over all the other code on that site, but one solution would be to find that weird function that has hijacked the $ variable and call it something else, but then you need to fix all calls to that function to be sure that you don’t break stuff in other places.

    #147888
    lprintz
    Participant

    I will give this a try…thanks so much!

    #147960
    lprintz
    Participant

    IT WORKED!

    Thanks for bailing me out Chromawoods!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.