Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Location
    N. Ireland
    Posts
    351
    Thanks
    16
    Thanked 4 Times in 4 Posts

    jQuery and Ajax Conflict

    Hi guys,

    Using jQuery Tabs to display some data but I also have an AjaxExpansion (WebObjects/WOnder feature) on the page. WOnder is smart and only includes the following on the page if Ajax is used:

    Code:
    <script type="text/javascript" src="/cgi-bin/WebObjects/.../WonderLatest/Frameworks/Ajax/Ajax/build/Ajax.framework/WebServerResources/prototype.js"></script>
    <script type="text/javascript" src="/cgi-bin/WebObjects/.../WonderLatest/Frameworks/Ajax/Ajax/build/Ajax.framework/WebServerResources/effects.js"></script>
    <script type="text/javascript" src="/cgi-bin/.../WonderLatest/Frameworks/Ajax/Ajax/build/Ajax.framework/WebServerResources/wonder.js"></script>
    The above scripts are written to the page at the very end of the head section.

    On the page I have the following:

    Code:
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
    <script type="text/javascript">
     $(document).ready(function() {
        $("#tabs").tabs();
      });
    </script>
    	
    <div id="tabs">
      <ul>
        <li><a href="#section-1" title="">Latest press</a></li>
        <li><a href="#section-2" title="">Latest PR</a></li>
    </ul>
    <div id="section-1">Section 1</div>
    <div id="section-2">Section 2</div>
    When done this way the Ajax is broken but the jQuery tabbing works.

    When I move the jQuery scripts into the head, the Ajax scripts which are written after the jQuery take precedence and the Ajax works but the jQuery tabs is broken.

    I have been scratching my head and need help. Any help appreciated.

    D.
    Daemonkin.
    If this was helpful, please add to my reputation
    Thousand Sons - Freelance Web Developer - ninetyonedegrees.com

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    I'm not familiar with Wonder, but it's including the Prototype JS library on your page.

    Use jQuery noConflict() to make them play nice together.


  •  

    Posting Permissions

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