473,387 Members | 1,388 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Cannot call asp page

103 100+
Hi all,

My html source is:
timeAj.html
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3. <script type="text/javascript">
Expand|Select|Wrap|Line Numbers
  1. function ajaxFunction()
  2.   {  var xmlHttp;
  3.   try
  4.     {   
  5.  // Firefox, Opera 8.0+, Safari    xmlHttp=new XMLHttpRequest();   
  6.  }
  7.   catch (e)
  8.     {   
  9.  // Internet Explorer  
  10.   try
  11.       {     
  12.  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");  
  13.     }
  14.     catch (e)
  15.       {     
  16.  try
  17.         {    
  18.     xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");    
  19.     }
  20.  
  21.  catch (e)
  22.         {       
  23.  alert("Your browser does not support AJAX!");  
  24.       return false;        
  25.  
  26. }     
  27.  }   
  28.  }
  29.     xmlHttp.onreadystatechange=function()
  30.       {
  31.       if(xmlHttp.readyState==4)
  32.         {
  33.         document.myForm.time.value=xmlHttp.responseText;
  34.         }
  35.       }
  36.     xmlHttp.open("GET","time.asp",true);
  37.     xmlHttp.send(null); 
  38.  }
Expand|Select|Wrap|Line Numbers
  1. </script>
  2. <form name="myForm">
  3. Name: <input type="text"
  4. onkeyup="ajaxFunction();" name="username" />
  5. Time: <input type="text" name="time" />
  6. </form>
  7. </body>
  8. </html>
and asp page is:
time.asp
...........
Expand|Select|Wrap|Line Numbers
  1. <%
  2. response.expires=-1
  3. response.write(time)
  4. %>
  5.  
But i cant call.time.asp into the main page...

I am new in Ajax...

Please help me...

Regards,
Mathew
Oct 25 '07 #1
4 1499
acoder
16,027 Expert Mod 8TB
If your code is as you have it typed here, look at the colours of the syntax highlighting. The XMLHttpRequest call has been commented out.

Remember to use code tags when posting code. As a full member, you should know that by now.
Oct 26 '07 #2
mathewgk80
103 100+
If your code is as you have it typed here, look at the colours of the syntax highlighting. The XMLHttpRequest call has been commented out.

Remember to use code tags when posting code. As a full member, you should know that by now.
HI,
I have changed the previous html code into the following..

timeAj.html
.................

[HTML]<html>
<body>
<script type="text/javascript">
[/HTML]
Expand|Select|Wrap|Line Numbers
  1. function ajaxFunction()
  2.  
  3. var xmlHttp;
  4.  
  5.   try
  6.  
  7.     {
  8.  
  9.     xmlHttp=new XMLHttpRequest(); 
  10.     }
  11.   catch (e)
  12.     {      
  13. try
  14.           {     
  15.  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");     
  16.      }
  17.     catch(e)
  18.         {     
  19. try
  20.         {        
  21.   xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");       
  22.      }
  23.       catch(e)
  24.         {      
  25.   alert("Your browser does not support AJAX!"); 
  26.  
  27.     return false;
  28.  
  29.     }     
  30.       }    
  31. }
  32.     xmlHttp.onreadystatechange=function()
  33.       {
  34.       if(xmlHttp.readyState==4)
  35.         {
  36.         document.myForm.time.value=xmlHttp.responseText;
  37.         }
  38.       }
  39.     xmlHttp.open("GET","time.asp",true);
  40.     xmlHttp.send(null);  
  41. }
[HTML]</script>
<form name="myForm">
Name: <input type="text"
onkeyup="ajaxFunction();" name="username" />
Time: <input type="text" name="time" />
</form></body>
</html>
[/HTML]
when i enter some value in the first textbox ie,to the Name field,
the Time field displays '<%' .. I dont know how to display the current time..
Please help me...

Regards,
Mathew
Oct 26 '07 #3
mathewgk80
103 100+
hi,
I have written time.asp page in the notepad and save the file in the same folder where timeAj.html saved...

Please help me..

HI,
I have changed the previous html code into the following..

timeAj.html
.................

<html>
<body>
<script type="text/javascript">

function ajaxFunction()
{

var xmlHttp;

try

{

xmlHttp=new XMLHttpRequest();
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e)
{
alert("Your browser does not support AJAX!");

return false;

}
}
}
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
document.myForm.time.value=xmlHttp.responseText;
}
}
xmlHttp.open("GET","time.asp",true);
xmlHttp.send(null);
}
</script>
<form name="myForm">
Name: <input type="text"
onkeyup="ajaxFunction();" name="username" />
Time: <input type="text" name="time" />
</form></body>
</html>

when i enter some value in the first textbox ie,to the Name field,
the Time field displays '<%' .. I dont know how to display the current time..
Please help me...

Regards,
Mathew
Oct 26 '07 #4
acoder
16,027 Expert Mod 8TB
I don't want to remind you again. Use code tags when posting code.

Try running the ASP page without Ajax. Does that work?
Oct 29 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Michael J. Astrauskas | last post by:
I have a site where a user logs in and a session variable I created is used to keep track of the fact that the user is logged in. This various pages query a MySQL database to get information...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
1
by: ericvdb | last post by:
Hi all, I'm trying to fill a PDF form with asp.net using the FDF Toolkit. I have a simple form with a textbox and a button. When the button is clicked, the pdf should open with the field filled...
2
by: Fluxray | last post by:
--Background: I have a webform including a datagrid. The datagrid is using template. Its ItemTemplate is used to display a look-up-table with labels. its EditItemTemplate is used to edit a row in...
1
by: Nalaka | last post by:
Hi, I have a webservice application(asp.net 2.0) running on IIS 6.0 ... win 2003. I can call the webservice from the local machine, but if I call the web service from a different machine, the...
2
by: Tim Reynolds | last post by:
Team, When my web service throws an exception and I am debugging on my PC - I get the exception back in my browser fine. My web.config shows <customErrors mode="Off"/> and this is working well. ...
7
by: dinamointer | last post by:
Could you help me in this problem: I want to launch an exe file(executable jar file) from a web page. I use jsp...and i cannot use vbScript...? could u tell me how should i do it? Thanks
19
by: lawrence k | last post by:
How can I find out where my script is outputting to the screen for the first time? My error logs are full of stuff like this: PHP Warning: session_start(): Cannot send session cache...
2
by: Griff | last post by:
Bizarre problem here.... I have a classic ASP web page that exists in one project. I have copied this code file into another web project and it errors! The code has not been altered in any...
1
by: jdub33 | last post by:
I have a web project that used a vb6 class library. The asp page would call a createobject() to access the class library. I recently updated the vb6 class library to .net2005. I unregistered the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.