PDA

View Full Version : Reuse javascript



jya
December 11th, 2001, 23:37
I would like to reuse a javascript in multiple pages. How can I do that ? I do want to repeat the code into multiple pages.

Eg.

<script>

function xWindow(){
window.open("http://www.abc.com","","height=400,width=400 ,scrollbars=yes");
}

</script>

andyLee
December 12th, 2001, 01:32
Put your scritp into a file like "yourscript.js"


and put the following into every page

<script src="yourscript.js"></script>