Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Conflict jQuery

  1. #1
    Join Date
    Apr 2011
    Posts
    75
    Thanks
    43
    Thanked 0 Times in 0 Posts

    Default Conflict jQuery

    Hello,...
    Any solution for conflict two js.jQuery file on same page.
    I have problem with :

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

    and this

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

    Thank you.

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    There's not going to be any easy way around that at all, at least not without modifying one of the scripts, meaning that you'd then end up having one incompatible with whatever other scripts use it.

    You should reduce it to just one. Why do you want both?

    I can imagine two situations:
    1. You want to use two different scripts, and each requires a certain version of jQuery. In this case, one of the scripts will be updated. But generally that difference (just a .1 difference) shouldn't be something you can't work out, at least for one script or the other.
    2. For some reason, you don't have complete control over the page and one version of jQuery is already included, but you need another one. You'll have to find some way to stop the first one, but I don't have any ideas on this without having more information.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. The Following User Says Thank You to djr33 For This Useful Post:

    rexi (08-29-2012)

  4. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,069
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    It depends upon the other scripts' code that use those. Generally anything that uses 1.3.2 can use 1.4.2, and probably they can both use 1.7.2 (latest I'm aware of).

    What I would try is getting rid of the second one on the page and replacing the first one on the page with:

    Code:
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
    which selects the latest available in the 1.7.x series.

    There can be other problems and not all code that uses older libraries will work well with the newer one, though sometimes older code works better with the newer library, more cross browser. Usually there's no noticeable difference.

    One thing to look out for is that one or more of your scripts that uses jQuery may have this:

    Code:
    jQuery.noConflict()
    in it. If it does, that should be commented out:

    Code:
    //jQuery.noConflict()
    The browser cache may need to be cleared and/or the page refreshed to see changes.

    If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. The Following User Says Thank You to jscheuer1 For This Useful Post:

    rexi (08-29-2012)

  6. #4
    Join Date
    Apr 2011
    Posts
    75
    Thanks
    43
    Thanked 0 Times in 0 Posts

    Default

    Thanks both guys,....
    I am using long time "magnifier"for images,..and I want put new script "expstickybar",..and that is problem conflict between.
    Mr.John,..I am try your solution,but for me not working, or I am not understood well.
    This is page for example.

  7. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,069
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    As far as I can tell, you haven't even followed the instructions for the scripts involved.

    Anyways, here's a demo:

    http://home.comcast.net/~jscheuer1/side/rexi/jq_h.htm
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. The Following User Says Thank You to jscheuer1 For This Useful Post:

    rexi (08-30-2012)

  9. #6
    Join Date
    Apr 2011
    Posts
    75
    Thanks
    43
    Thanked 0 Times in 0 Posts

    Default

    Thank you John,..but still no change.I think that is problem server of blog.On your empty HTML working perfect,..but on my page no.No problem about that,..I will move out one from them.
    Thanks.

  10. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,069
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    Well, the sticky bar does require a standards invoking DOCTYPE. And the way you have it configured, at least an empty stickybarcontent.htm file in the same folder as the page. Those two are part of what I was saying about not following the instructions for the scripts. At least the magnifier is working.

    There are some other issues, but let's try fixing those two and see what happens. Put this:

    Code:
    <!DOCTYPE html>
    as the very first thing in the source code of the page, and upload an empty file called stickybarcontent.htm to the same folder.

    The browser cache may need to be cleared and/or the page refreshed to see changes.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  11. The Following User Says Thank You to jscheuer1 For This Useful Post:

    rexi (08-30-2012)

  12. #8
    Join Date
    Apr 2011
    Posts
    75
    Thanks
    43
    Thanked 0 Times in 0 Posts

    Default

    Thank you,..
    Same situation.I put "doctype" on the top,..and also I put "stickybarcontent.htm".
    Link

  13. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,069
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by rexi View Post
    Same situation . . . and also I put "stickybarcontent.htm" . .
    Nope that file:

    http://ddr10.blogger.ba/stickybarcontent.htm

    is still a 404 Not Found.

    And from the error message I'm getting in Firefox at least, it looks like that's all that's missing. You can also remove:

    Code:
    <script type="text/javascript">
    var mystickybar=new expstickybar({id:"stickybar",position:'top',revealtype:'mouseover',peekamount:30,externalcontent:'stickybarcontent.htm',speed:300})
    </script>
    Because that or similar is already in the main stickybar script. But having it twice shouldn't be causing it not to work at all.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  14. The Following User Says Thank You to jscheuer1 For This Useful Post:

    rexi (08-30-2012)

  15. #10
    Join Date
    Apr 2011
    Posts
    75
    Thanks
    43
    Thanked 0 Times in 0 Posts

    Default

    Sorry for that,..this is just blog,..not web site and I can't make any htm.
    This code is not causing problem,..I used because,I can change "peekamount" without editing main js.file.

    Code:
    <script type="text/javascript">
    var mystickybar=new expstickybar({id:"stickybar",position:'top',revealtype:'mouseover',peekamount:30,externalcontent:'stickybarcontent.htm',speed:300})
    </script>
    Thank you for your help and time for me.

Similar Threads

  1. Lightbox , jquery.min.js Conflict
    By Monclee in forum Dynamic Drive scripts help
    Replies: 6
    Last Post: 03-06-2012, 04:57 AM
  2. Lightbox Jquery conflict
    By smallbirdmedia in forum JavaScript
    Replies: 1
    Last Post: 02-29-2012, 01:01 AM
  3. Jquery Conflict
    By James Church in forum JavaScript
    Replies: 0
    Last Post: 05-24-2011, 11:20 AM
  4. jquery conflict
    By shereenm in forum JavaScript
    Replies: 0
    Last Post: 04-30-2011, 03:02 PM
  5. Conflict with jQuery?
    By Gazzab in forum JavaScript
    Replies: 1
    Last Post: 01-15-2010, 05:44 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •