Retrieving time value from an asp page into a javascript function- ajax used

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Teenzonez
    New Member
    • Mar 2007
    • 36

    Retrieving time value from an asp page into a javascript function- ajax used

    Hi
    I am doing a simple application using ajax which wil fetch time from server to a javascript function.
    i have one html file and one asp page.
    In the html page i have two text boxes by name 'username' and 'time'.
    The functionality intended to implementd is when you type somethin on the username textbox the server time should come on the time textbox without page reload.
    The time information is coming ffrom an asp page time.asp whose content is
    <%
    response.expire s=-1
    response.write( time)
    %>
    when i start the html page, as soon as i write something on the username text box the whole content of the asp page is coming on the time textbox.ajax technology is working fine bcos im getting the result without reloading the page.

    But i want the time thats coming from the asp page.
    in the ajax function im using xmlHttp.respons eText;
    xmlhttp is an activexobjet with parameter as "Microsoft.XMLH TTP".



    Regards
    TeenzoneZ
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    I assume this is from the W3Schools tutorial. Check that it's been copied exactly as described in the tutorial.

    Comment

    • myth0s
      New Member
      • Jan 2008
      • 32

      #3
      Originally posted by Teenzonez
      Hi
      I am doing a simple application using ajax which wil fetch time from server to a javascript function.
      i have one html file and one asp page.
      In the html page i have two text boxes by name 'username' and 'time'.
      The functionality intended to implementd is when you type somethin on the username textbox the server time should come on the time textbox without page reload.
      The time information is coming ffrom an asp page time.asp whose content is
      <%
      response.expire s=-1
      response.write( time)
      %>
      when i start the html page, as soon as i write something on the username text box the whole content of the asp page is coming on the time textbox.ajax technology is working fine bcos im getting the result without reloading the page.

      But i want the time thats coming from the asp page.
      in the ajax function im using xmlHttp.respons eText;
      xmlhttp is an activexobjet with parameter as "Microsoft.XMLH TTP".



      Regards
      TeenzoneZ
      The code provided with the tutorial should work fine. If you get the content of the file (instead of the time), you should make sure your server can handle ASP pages.

      Comment

      Working...