PDA

View Full Version : javascript confilcts ...what should i do



jonnyfreak
11-07-2012, 02:07 PM
Hello I wonder I have a page that has some spry validation assets and also a jquery datepicker.

this is the following code i have in the header


<script type="text/javascript" src="js/jquery.js"></script>
<link type="text/css" href="css/ui-lightness/jquery-ui-1.8.17.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-ui-1.8.17.custom.min.js"></script>
<script type="text/javascript" src="js/date.format.js"></script>

with just this the datepicker script in place it works fine

however when i add the following


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.min.js"></script>


the datepicker css does kick in...

the trouble is i need all these scripts.

Beverleyh
11-07-2012, 02:24 PM
Probably because you've got conflicting (multiple) jquery libraries.

Just link to the most recent jquery library/plugins and reference the main jquery library first (before all the plugins).

You can link to the js stored in googleapis, or download and store them on your own server, but you dont need to both.

If you need more help, please post a link to your actual page.

Thanks

jonnyfreak
11-07-2012, 02:30 PM
thanks for the advice i have deleted


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.min.js"></script>

to see if this caused a problem but doesnt seemed to.

thanks again