JQuery download function does not link to the main page of script files

I am using the jquery download function in my masterpage.html application and it works fine. But the problem is that I need to place Jquery.min.js on all my content pages in order to use jquery functionality on my content page. I do not want to include it on all pages. It should link to my home page.

<html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"> <script type="text/javascript"> function loadContent(pagename) { $("#output").load(pagename); } </script> </head> <body> <a href="#" onclick="loadContent('about.html')">About</a> <div id="output"></div> </body> </html> 

about.html

 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"> <div id="content"> This is about page !! </div> 

As you see my about.html again, including jquery, to use it on my about.html page. How to avoid this on all pages? Please, help

+2
java javascript jquery jquery-ui
Apr 23 '14 at 5:16
source share
2 answers

No, It is Immpossible. You must enable it on all pages where you use jquery

Instead of referencing the url as shown below,

 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"> 

You can load the jquery library in your project path and use it as

 <script src="project_name/folder_name/jquery.min.js"> 

But be sure to include jquery on all pages

Hope this helps!

0
Apr 23 '14 at 5:30
source share

I canโ€™t give you a better answer, this is my advice

  • The jQuery file is best included at the bottom of the body tag.
  • If you are using jQuery, you must enable it.
0
Apr 23 '14 at 5:32
source share



All Articles