tags:

views:

246

answers:

2

hi all

how it can be implemented that- load jquery file dynamically whether it is not loaded??? or if loaded then ignore further load.,.??

thanks

+1  A: 
<script type="text/javascript">
if (typeof jQuery == 'undefined')
{
    document.write(unescape("%3Cscript src='/path/to/your/jquery' type='text/javascript'%3E%3C/script%3E"));
}
</script>
Randell
<script type="text/javascript"> if (typeof jQuery == 'undefined') { document.write(unescape("%3Cscript src='development-bundle/jquery-1.3.2.js' type='text/javascript'%3E%3C/script%3E")); document.write(unescape("%3Cscript src='development-bundle/ui/ui.core.js' type='text/javascript'%3E%3C/script%3E")); } $(function(){ // Datepicker $('#datepicker').datepicker(); }); </script>is it posible???
nazmul hasan
but showing error
nazmul hasan
A: 

Have a look at getScript. It will load a script file, and a callback function is run when the loading is done.

Marius