View Single Post
Old 06-22-2011, 08:41 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,579
Thanks: 62
Thanked 4,063 Times in 4,032 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
The first block of JS can be most anywhere on the page *BEFORE* where you want the countdown. I'd suggest putting it in the <head>...</head>

Since you don't show us a link to where you got that code, and since the URL hashemian.com doesn't seem to exist (which makes me wonder if that script is going to work, if it can't be found!), you *probably* can do something like this:
Code:
<div id="ClockHere">
<script language="JavaScript" src="http://scripts.hashemian.com/js/countdown.js"></script>
</div>
And then just use <style> to apply CSS to div#ClockHere

EDIT: I just tried using this on my own page, and it only worked sporadically. First it couldn't find the URL, then it could. You might want to copy the ".js" file to your own server so it will be more reliable.

The code isn't the best in the world. The fact that it uses language="JavaScript" shows it is a bit on the old-fashioned side. But what the heck, it works.

I also tried a page just as I describe above, with the second script inside an absolutely positioned <div>, and it worked as predicted.
Old Pedant is offline   Reply With Quote
Users who have thanked Old Pedant for this post:
Emiil (06-22-2011)