any reason why this code example wont work?

  • Thread starter Thread starter Milsnips
  • Start date Start date
M

Milsnips

Hi there,

i have 2 pages: default.aspx and getTime.aspx

1. getTime.aspx has one line: "response.write(datetime.now())"
2. default.aspx has the following html code: "<script type="text/javascript"
src="getdate.aspx"></script>"

When i run it it does nothing except return me a javascript error saying:
Line 2, Char 12, Expected ";".. which i have got no idea here as i've only
typed in 1 response.write line.

any help appreciated,
thanks,
Paul
 
Hi there,

i have 2 pages: default.aspx and getTime.aspx

1. getTime.aspx has one line: "response.write(datetime.now())"
2. default.aspx has the following html code: "<script type="text/javascript"
src="getdate.aspx"></script>"

When i run it it does nothing except return me a javascript error saying:
Line 2, Char 12, Expected ";".. which i have got no idea here as i've only
typed in 1 response.write line.

any help appreciated,
thanks,
Paul

Hello Paul:
You are just saying to getTime.aspx "hey, show me the current time".
And in the other, you are just referencing a javascript source file
that does'n exist, cause default.aspx is at least html code, not
javascript. What are you trying to do?
Oscar
 
Ok what i'm trying to do is use the server side DateTime class to get the
UTC time and display it on the page. I've tried it in javascript, but it
isnt giving me the results i'm after as javascript works on the local pc and
if the time is incorrect, it will show incorrectly.

So all i want to do is call the getTime.aspx via the <script> tag and in its
place write out the time.

thanks,
Paul
 
Back
Top