views:

503

answers:

1

Hi, I'm having trouble loading JQueryUI from Google's CDN. I've got an ASP.NET application that and am using this to call the scripts:

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> 
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js" type="text/javascript"></script> 
    <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/ui-darkness/jquery-ui.css" rel="stylesheet" type="text/css" />


<script type="text/javascript">
    $(function() {

        $("#accordion").accordion();
    });
    </script>
</asp:Content>

I then have a test accordion:

<div id="accordion">
    <h3><a href="#">First header</a></h3>
    <div>First content</div>
    <h3><a href="#">Second header</a></h3>
    <div>Second content</div>
</div>

However, this doesn't work. I used Chrome's Dev tool and I get this error: Uncaught Error: The 'accordion' plugin requires Sys.scripts.ExtendedAccordion to be loaded with a call to Sys.require() first

I'm also using MS' Ajax CDN in my masterpage, so could that be causing a problem?

Thanks

+3  A: 

It looks like you have a conflict between the MS Ajax oolkit accordion and the jQuery UI accordion. Can you remove the Ajax Toolkit?

tvanfosson
I've been trying to remove the AJAX Toolkit and shift to JQuery, but there are still quite a few pages using the toolkit (through the MS AJAX CDN). Will the conflict only be resolved if I remove all the Ajax Toolkit components? thanks
keyboardP
Try using jQuery in noConflict mode and referencing the accordion plugin using jQuery() instead of $().
tvanfosson
I gave that a shot, but it doesn't seem to work. I'll remove any of the other MS Ajax dependencies first and then come back to this.Thanks for the help
keyboardP