Welcome Guest, Not a member yet? Register   Sign In
Can I define my custom jquery globally?
#1

[eluser]Katsune[/eluser]
Hey guys,

I noticed that if I load an ajax on a page, the jquery and my own jquery code on the footer are not accessible to the ajax that was loaded, unless I also define the jqueries inside the php code that the ajax is going to call. So there will be reduntant jquery. Is there a way to just load it in config or auto load? including my custom one?

Thanks,
#2

[eluser]www.sblog.in[/eluser]
Better you can load the jquery files in template file
#3

[eluser]InsiteFX[/eluser]
All jQuery files should be entered at the bottom of your html page, unless it is needed before hand then load it in the head section.

This to speed up page load times.

Code:
// Replace the $ sign in the script tags with s

<!-- Get Jquery library from Google. -->
<$cript src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></$cript>

&lt;!-- Bootstrap.js, Jquery plugins and custom Javascript code --&gt;
<$cript src="&lt;?php echo base_url('assets/js/bootstrap.min.js'); ?&gt;"></$cript>

&lt;!-- Custom jQuery code for this page only! --&gt;
<$cript src="&lt;?php echo base_url('assets/js/main.js'); ?&gt;"></$cript>

&lt;/body&gt;
&lt;/html&gt;
#4

[eluser]Katsune[/eluser]
Thanks,
#5

[eluser]Tpojka[/eluser]
Just in case, after googleapis script, check if it is loaded or load your own source:

link.

Disclaimer: be aware of combination of quotes and double quotes.




Theme © iAndrew 2016 - Forum software by © MyBB