Welcome to WebmasterWorld Guest from 3.80.6.254

Forum Moderators: open

Message Too Old, No Replies

external script

wont work

     
9:54 pm on Nov 1, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:June 23, 2003
posts:167
votes: 0


I have been using a countup clock on every page of my site, the code has been pasted into the table cell where i want the clock to appear, however i am now trying to put the script into an external file, when i type the script location or this---
<script type="text/javascript" language="JavaScript" src="javascript/timecount.js"></script>
--- into the head section the clock appears in the top left of the screen and the rest of the page looses all text and images, so at least i know it can see the external file, so why does the browser stop reading the rest of the html code and how do i get this following code to appear on the table cell i want it to. here's the start of the js.

function setcountup(theyear,themonth,theday)
{
yr=theyear;mo=themonth;da=theday
}

Regards Ian(total js. novice)

11:09 pm on Nov 1, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:July 18, 2003
posts:167
votes: 0


put it in the body and see if that works.
11:23 pm on Nov 1, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:June 23, 2003
posts:167
votes: 0


Starting to make progress, the clocks now on the screen, the pages looks ok, but it's still in the top left of the screen, how do I tell the script to appear in the table cell i want it to appear in, can i give it a class id like in css and if so what would it be.
Thanks for all help so far.
11:26 pm on Nov 1, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:July 26, 2003
posts:881
votes: 0


Put the script right where you want the clock. Most likely the script is just doing document writes, so it will write to the same exact place where it is called from. So, for example...

<table> 
<tr>
<td>
<script type="text/javascript" src="javascript/timecount.js">
</script>
</td>
</tr>
</table>

Jordan

11:41 pm on Nov 1, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:June 23, 2003
posts:167
votes: 0


Jordan

Thankyou very much, done what you said and it's working a treat,

What a relief when you hit the refresh button and things work how you want.

Regards Ian

12:19 am on Nov 2, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:July 26, 2003
posts:881
votes: 0


Ian:

No worries, I totally know the feeling (especially when the previous 30 refreshes didn't turn out so hot, lol). ;)

Jordan