Problem in IE

Last post 07-06-2009 3:47 AM by Thomas Sun – MSFT. 1 replies.

Sort Posts:

  • Problem in IE

    07-02-2009, 3:05 AM
    • Member
      87 point Member
    • shanker
    • Member since 12-16-2008, 6:46 AM
    • Tamilnadu
    • Posts 69

    Hi,

    I used AJAX to load a page as a popup window.

    But it works well in firefox and other browsers,but its not working in IE.


    Here's the code.


    var xmlHttp;
        var GetId;
        var Method;
        function Editpopup(val,stat)
        {
            GetId=val;
            Method=stat;
            //alert(GetId);
            xmlHttp=GetXmlHttpObject();
            if (xmlHttp==null)
            {
                alert ("Browser does not support HTTP Request");
                return;
            }
            var url;
            url="editradiography.aspx?form="+Method+"&id="+GetId;
            url=url+"&sid="+Math.random()
            xmlHttp.onreadystatechange=Changed_state ;
            xmlHttp.open("GET",url,true);
            xmlHttp.send(null);
        }
        function Changed_state()
        {
            if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
            {          
                //alert(document.getElementById("div_Edit").style.display);  
                var result = xmlHttp.responseText;
                //alert(result);
                document.getElementById("div_Edit").innerHTML="";
                document.getElementById("div_Edit").innerHTML = result;
            }
            else if(xmlHttp.readyState <= 3)
            {
                document.getElementById("div_Edit").style.display="block";
                document.getElementById("div_Edit").innerHTML= "Loading...";  
            }  
        }    
      
        function Changedstate()
        {
            if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
            {     
                //alert(xmlHttp.responseText);
                document.getElementById("div_Edit").innerHTML=xmlHttp.responseText;          
                //document.getElementById("div_Edit").style.display="none";
                //window.close();
               window.location.reload()
            }  
        }
        function GetXmlHttpObject()
        {
            var objXMLHttp=null;
            try
            {
                return new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e)
            {
            }
            try
            {
                return new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e)
            {
            }
            try
            {
                return new XMLHttpRequest();
            }
            catch(e)
            {
            }
            return objXMLHttp;
        }    
     

  • Re: Problem in IE

    07-06-2009, 3:47 AM

    Hi,

    To better understand your issue, please confirm the follow information: Did you get any error message? What is your IE version?

    We need to make sure we create XMLHttpRequest object correctly. You can try the following process to create it:

        function GetXmlHttpObject()
        { 
            var objXMLHttp=null;
    
    
            if(window.XMLHttpRequest)
            {
                // For IE7, Mozilla, Safari, Opera, etc
                objXMLHttp = new XMLHttpRequest();
            }
            else if (window.ActiveXObject) //For IE 5.X, 6
            {
                try
                {
                    objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch(e)
                {
                
                }
            }
            return objXMLHttp;
        }  


    I look forward to receiving your test results.

    Thomas Sun
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
Page 1 of 1 (2 items)