In this case you won't be able to just drop the script into a .js file, since the following line of code within it needs to be dynamically parsed based on your page's type (ie: .shtml, .php etc):
Code:
var servertimestring=(servermode=="server-php")? '<? print date("F d, Y H:i:s", time())?>' : (servermode=="server-ssi")? '<!--#config timefmt="%B %d, %Y %H:%M:%S"--><!--#echo var="DATE_LOCAL" -->' : '<%= Now() %>'
Once you put the script in a .js file, it's no longer parsed correctly. What you can do is move the above line of code to the page itself:
Code:
Local Time in Lima:<span id="timecontainer"></span>
<script type="text/javascript">
var servertimestring=(servermode=="server-php")? '<? print date("F d, Y H:i:s", time())?>' : (servermode=="server-ssi")? '<!--#config timefmt="%B %d, %Y %H:%M:%S"--><!--#echo var="DATE_LOCAL" -->' : '<%= Now() %>'
new showLocalTime("timecontainer", "server-php", -420, "short")
</script>
That should work. There are other ways as well, for example, if your pages are PHP pages, you can output the entire .js file as a .php file (see this tutorial: http://www.javascriptkit.com/javatut...rnalphp.shtml).
Bookmarks