ajax response elements and IE8 conflict

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • omerbutt
    Contributor
    • Nov 2006
    • 638

    #1

    ajax response elements and IE8 conflict

    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 onreadystatecha nge event as soon as it checks the xmlhttpobj.stat us or xmlhttpobj.read yState 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
    [CODE=HTML]
    <td align='center' class='textnorm al' valign="middle" >
    <input type="text" name="order_id_ <?=$countO?>" id="order_id_<? =$countO?>" value="<?=$orde r_id?>" style="width:25 px;" />
    <a href="#." onclick="chkExi st(document.get ElementById('or der_id_<?=$coun tO?>').value,do cument.getEleme ntById('home_id _<?=$countO?>') .value,'<?=HOME S?>')">Update</a> </td>
    <input type="hidden" name="home_id_< ?=$countO?>" id="home_id_<?= $countO?>" value="<?=$home _id;?>" />
    [/CODE]
    [CODE=javascript]
    var xmlOderUpdate=n ull;
    function updateOrder(ord erId,rec_id,tab le){
    xmlOderUpdate=G etXmlHttpObject ();
    if(xmlOderUpdat e==null){
    alert("you need to upgrade your browser");
    return;
    }else{
    var url="ajax/order-update.php";
    var str="table="+ta ble+"&orderId=" +orderId+"&rec_ id="+rec_id;
    xmlOderUpdate.o nreadystatechan ge=$updateOrder ;
    xmlOderUpdate.o pen("POST",url, true);
    xmlOderUpdate.s etRequestHeader ("Content-Type","applicat ion/x-www-form-urlencoded; charset=UTF-8");
    xmlOderUpdate.s end(str);
    }
    }
    function $updateOrder(){
    if(xmlOderUpdat e.readyState==4 ){
    if(xmlOderUpdat e.status==200){
    if(xmlOderUpdat e.responseText= ="done"){
    location.replac e(window.locati on());
    }else{
    alert("There was a problem updating, please try later");
    }
    }
    }
    }
    var xmlIsThere=null ;
    function chkExist(orderI d,rec_id,table) {
    xmlIsThere=GetX mlHttpObject();
    if(xmlIsThere== null){
    alert("you need to upgrade your browser");
    return;
    }else{
    var url="ajax/order-chk.php";
    var str="table="+ta ble+"&orderId=" +orderId+"&rec_ id="+rec_id;
    xmlIsThere.onre adystatechange= $chkExist;
    xmlIsThere.open ("POST",url,tru e);
    xmlIsThere.setR equestHeader("C ontent-Type","applicat ion/x-www-form-urlencoded; charset=UTF-8");
    xmlIsThere.send (str);

    }
    }
    function $chkExist(){
    if(xmlIsThere.r eadyState==4){
    if(xmlIsThere.s tatus==200){
    var res=xmlIsThere. responseText;
    var resar=res.split ("|");
    if(resar[0]=="Yes"){
    var act=confirm('Po sition Already defined Do You Still Want to update');
    if(act==true){
    updateOrder(res ar[1],resar[2],resar[3]);
    }
    }else{
    updateOrder(res ar[1],resar[2],resar[3]);
    }
    }
    }
    }
    [/CODE]
Working...