homepage Welcome to WebmasterWorld Guest from 54.237.95.6
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
how to handle repeated javascript code in many html files
so that it can be changed later easily
lalit




msg:3981790
 7:34 am on Sep 1, 2009 (gmt 0)

I am going to use several html pages, and there is a javascript code that is being repeated on every page. how can i make it possible that the code may be changed any time easily (just by changing it in one common file).
The code which is being repeated is also javascript code.

 

Alternative Future




msg:3981904
 12:29 pm on Sep 1, 2009 (gmt 0)

Hi lalit

Here is a post that might help explain what you are looking to do... [webmasterworld.com...]

HTH

-Gs

lalit




msg:3983302
 11:15 am on Sep 3, 2009 (gmt 0)

thanx it works.

can you tell me the way if the code is html code instead of jsp should i use document.write or there is better way.

Fotiman




msg:3983781
 1:52 am on Sep 4, 2009 (gmt 0)

To include JavaScript in many HTML pages, you don't need document.write. Simply include the JavaScript file from each page, as in:

<script type="text/javascript" src="yourjsfile.js"></script>

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved