I think you want to a reference to the script on the pages, a search and replace is just more work if you have to change the script, plus it adds bulk to each of your pages, while the linked JS file will be cached.
Just put this code in the header (between <head> and </head>) of all the files that need to reference the code, and change "script.js" to the location of your script file:
Code:
<script type="text/javascript" src="script.js"></script>
and "script.js" is a plain text file with your JavaScript code in it. Then you only need to change and upload 1 file to update all the files with new JS code.
|