Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

how to handle repeated javascript code in many html files

so that it can be changed later easily



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

5+ Year Member

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

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

WebmasterWorld Senior Member 10+ Year Member

Hi lalit

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




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

5+ Year Member

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.


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

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

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>


Featured Threads

Hot Threads This Week

Hot Threads This Month