473,320 Members | 2,133 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,320 software developers and data experts.

ASP Ajax Problem

I just inherited this code from someone who developed it back in 02. I need to move the site over to a new IIS Server.

This script resides on a web form calculator all of the other JavaScript’s work but when I try to call the save function I get a time out error in the browser. Does anyone know why this would not be working on IIS?
Expand|Select|Wrap|Line Numbers
  1. function saveData() 
  2. {
  3.  
  4.     if(window.XMLHttpRequest) {
  5.         xml_http = new XMLHttpRequest();
  6.     } else if(window.ActiveXObject) {
  7.         xml_http = new ActiveXObject("Microsoft.XMLHTTP");
  8.     }
  9.  
  10.     xml_http.onreadystatechange = show_results;
  11.     xml_http.open("POST", "goal.php", true);
  12.     xml_http.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
  13.     str = getFormElements("frmdata");
  14. //alert(str);
  15.     xml_http.send(str);
  16.  
  17. }

Thanks,
Scott
Jan 26 '10 #1
2 1372
Frinavale
9,735 Expert Mod 8TB
I'm not that good with Ajax but that particular ActiveX object that IE uses to make Ajax calls might not be available.

Try the following to attempt to retrieve the apppropriate ActiveX required for IE to make Ajax calls:
Expand|Select|Wrap|Line Numbers
  1. function GetXmlHttp()
  2. {   /*This function is responsible for creating an HttpRequest object 
  3.       based on the browser that the user is currently using. */
  4.   var xmlHttp = null;            
  5.   try
  6.   {   //Mozilla, Opera, Safari etc.
  7.     xmlHttp=XMLHttpRequest();
  8.   }catch(e)
  9.   {   //Internet Explorer uses ActiveX objects to make Ajax calls.
  10.       //the following are valid versions, here we will loop through 
  11.       //the versions and attempt to create the ActiveX that matches the browser.
  12.     var versionIds = ["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0",
  13.         "Msxml2.XMLHTTP.4.0","Msxml2.XMLHTTP.3.0", 
  14.         "Msxml2.XMLHTTP.2.6","Microsoft.XMLHTTP.1.0", 
  15.         "Microsoft.XMLHTTP.1","Microsoft.XMLHTTP"];
  16.     for(var i=0; i<versionIds.length && xmlHttp == null; i++) 
  17.     {
  18.       xmlHttp = CreateXmlHttp(versionIds[i]);
  19.     }
  20.   }
  21.   return xmlHttp;
  22. }
-Frinny
Feb 17 '10 #2
Curtis Rutland
3,256 Expert 2GB
A timeout error could suggest a problem with the target page. Make sure everything is working as expected on that page.
Feb 17 '10 #3

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

Similar topics

4
by: bobzimuta | last post by:
I'm creating a simple AJAX library. It's an object that will return an array containing the response text or xml. I'm trying to find a way to assign the response as a property of the object, but...
31
by: Tony | last post by:
I just noticed that prototype.js is one of the files in the Ajax.NET distribution - I'm pretty concerned about this. Does anyone know if this is the same "prototype.js" that is not well-liked...
5
by: Martin | last post by:
Hello NG, I've been doing some AJAX for a few weeks now. The basics worked fine so far, but now I've got the following problem which I can't solve: With AJAX you typically update/replace only...
3
by: Alok yadav | last post by:
I have an open IP and on that IP our main application is hosted. it uses ajax. in web.config file i have register ajax handlers. there are also other sites or project on that IP. now my problem is...
3
by: equazcion | last post by:
Hi, I have an image reference (IMG) in my page that changes depending on the value of a database field. Clicking the image triggers an Ajax call to change the database field (toggles the field...
7
by: tommurray | last post by:
Hi all Hope someone can help with the problem I am having as it is driving me nuts! I have the below script on my site the problem lies with passing through a url parameter in the below line...
6
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick...
2
by: shivendravikramsingh | last post by:
hi friends, i m using a ajax function for retrieving some values from a database table,and display the values in required field,my prob is that the ajax function i m using is working f9 once,but if...
3
by: willl69 | last post by:
Hi All, Ive been having a problem of late with one of my sites that uses PHP5 / Ajax. The problem is that periodically the ajax functions lock up and it gets stuck in the loading phase of the...
2
by: majidtou | last post by:
Hi , We have an HTML page which is using AJAX. We make an AJAX call which retrieves a table with mutiple rows. We need to extend this functionality. In the table, we want to put a button on each...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.