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

ajax response elements and IE8 conflict

omerbutt
638 512MB
hi i have an application in which i an trying to update order for the occurrence of the users who are marked to view on the front end ,
now i dont have any problem working around to change the status for the order or manipulating the values of the databases, but there is a serious issue with IE 8 that , when i click update button the script executes ,accesses the file and when it enter the onreadystatechange event as soon as it checks the xmlhttpobj.status or xmlhttpobj.readyState it gives me unspecified error
i have been working with AJAX for so long but i couldnot
figure out this error any body here to help
Expand|Select|Wrap|Line Numbers
  1. <td align='center' class='textnormal' valign="middle">
  2. <input type="text" name="order_id_<?=$countO?>" id="order_id_<?=$countO?>" value="<?=$order_id?>" style="width:25px;" />
  3. <a href="#." onclick="chkExist(document.getElementById('order_id_<?=$countO?>').value,document.getElementById('home_id_<?=$countO?>').value,'<?=HOMES?>')">Update</a>                   </td>
  4.      <input type="hidden" name="home_id_<?=$countO?>" id="home_id_<?=$countO?>" value="<?=$home_id;?>"  />
  5.  
Expand|Select|Wrap|Line Numbers
  1. var xmlOderUpdate=null;
  2. function updateOrder(orderId,rec_id,table){
  3.     xmlOderUpdate=GetXmlHttpObject();
  4.     if(xmlOderUpdate==null){
  5.         alert("you need to upgrade your browser");
  6.         return;
  7.     }else{
  8.         var url="ajax/order-update.php";
  9.         var str="table="+table+"&orderId="+orderId+"&rec_id="+rec_id;
  10.         xmlOderUpdate.onreadystatechange=$updateOrder;
  11.         xmlOderUpdate.open("POST",url,true);
  12.         xmlOderUpdate.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
  13.         xmlOderUpdate.send(str);
  14.     }
  15. }
  16. function $updateOrder(){
  17.     if(xmlOderUpdate.readyState==4){
  18.         if(xmlOderUpdate.status==200){
  19.             if(xmlOderUpdate.responseText=="done"){
  20.                 location.replace(window.location());
  21.             }else{
  22.                 alert("There was a problem updating, please try later");
  23.             }
  24.         }
  25.     }
  26. }
  27. var xmlIsThere=null;
  28. function chkExist(orderId,rec_id,table){
  29.     xmlIsThere=GetXmlHttpObject();
  30.     if(xmlIsThere==null){
  31.         alert("you need to upgrade your browser");
  32.         return;
  33.     }else{
  34.         var url="ajax/order-chk.php";
  35.         var str="table="+table+"&orderId="+orderId+"&rec_id="+rec_id;
  36.         xmlIsThere.onreadystatechange=$chkExist;
  37.         xmlIsThere.open("POST",url,true);
  38.         xmlIsThere.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
  39.         xmlIsThere.send(str);
  40.  
  41.     }
  42. }
  43. function $chkExist(){
  44.     if(xmlIsThere.readyState==4){
  45.         if(xmlIsThere.status==200){
  46.             var res=xmlIsThere.responseText;
  47.             var resar=res.split("|");
  48.             if(resar[0]=="Yes"){
  49.                 var act=confirm('Position Already defined Do You Still Want to update');
  50.                 if(act==true){
  51.                     updateOrder(resar[1],resar[2],resar[3]);
  52.                 }
  53.             }else{
  54.                 updateOrder(resar[1],resar[2],resar[3]);
  55.             }
  56.         }
  57.     }
  58. }
  59.  
Aug 30 '10 #1
0 1228

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

Similar topics

12
by: petermichaux | last post by:
Hi, In my browser, I make an AJAX request. The server sends me a fragment of an HTML document. That fragment has some JavaScript inside some script tags. How do I run these scripts when the...
1
by: GSlusarek | last post by:
Hi all. I made AJAX call which return me a piece of javascript code. I trying to execute that code and I get that some global variables are not accesible. I mean i use prototype library and when i...
4
by: evgenyg | last post by:
Hello ! We have the following situation - when Ajax request is sent what's being returned by the server is usually an XML (which is used for DOM updates) but sometimes it's HTML which is a whole...
5
by: petermichaux | last post by:
Hi, Some servers return JavaScript as the response to an AJAX request. When the response JavaScript is eval'ed it calls other JavaScript functions already in the browser to update elements, etc....
10
by: trpost | last post by:
I am using ajax / php where I am looking up some info from the database and populating a select list dynamically, however I am running into some sort of size limitation with the ajax.response...
1
by: dan.goyette | last post by:
I'm fairly new to using AJAX. I'm currently developing a data grid application in coldfusion, using AJAX for paging/filter/sorting updates to the grid. So far I've just been returning raw html, and...
2
by: FrogBunz | last post by:
Is there a way to execute inline javascript code from within an AJAX response? I use AJAX to retrive a JSP page that is loaded using a database bean. One of the form elements is a select that I...
1
by: maildmz | last post by:
Goodafternoon, I have got a minimum Mongrel instance running (see ruby code) and i am hitting it with an Ajax request using Prototype. (see javascript code) I get the 'onLoading' event, but...
1
by: gigitek | last post by:
In my first php file I have a table with multiple rows and form fields. When the user selects a category I call a second php file which returns new rows (<tr>) which have to be added to the table...
3
by: pablosuk78 | last post by:
Dear coders, I'm facing a problem and after few research I found that many ppl were looking around for the same solution, hope someone more expert than me could give a good help. I created an...
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.