any reason why this code example wont work?

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
 
C

Cubaman

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
 
M

Milsnips

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top