Richard
Richard

Reputation: 1739

JQuery messes layout of web page

I had a working Spring Roo webapp, but it didn't have any jQuery in it.

Now I want to add some Ajax functionality, so I downloaded the jQuery .js file, and included it in my "head" section of my layout file like this:

<script type="text/javascript" src="/MyApp/js/jquery-1.7.1.js"></script>

Now, when I load the app up, all my resources have disappeared (images etc). The main pages all work ok, but they look really basic because the images/styles etc etc have gone.

I took a "view source" of the generated HTML page before and after adding the "script" element, and they are identical (according to WinMerge). No errors in FireFox's error console either.

What have I done wrong?

Thanks

Upvotes: 1

Views: 179

Answers (1)

Nicola Peluchetti
Nicola Peluchetti

Reputation: 76880

You should try using noConflict()

<script type="text/javascript" src="/MyApp/js/jquery-1.7.1.js"></script>
$.noConflict();
//use only jQuery instead of $ from here

if your sites works ok after doing this you probably have another framework installed and this is conflicting with jQuery

Upvotes: 2

Related Questions