Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jul 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer Problems showing the xmlHttp.responseText in MIE7

    My code works fine in Internet Explorer 8 but I was told it doesn't work in Internet Explorer 7.

    Can you have a look at what might go wrong, thank you.
    In my .js file:
    PHP Code:
    var xmlHttp
    //str1 is my div id
    //str2 is my url string
    function showBlogcomments(str1,str2)

    {
    xmlHttp=GetXmlHttpObject();
    if (
    xmlHttp==null)
      {
      
    alert ("Your browser does not support AJAX!");
      return;
      } 
    var 
    url="http://www.myurl.com/shop/blog/show_blogcomments.asp";
    url=url+"?"+str2+"&swow="+Math.random();

    xmlHttp.onreadystatechange=stateChanged;
    xmlHttp.id str1;
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
    }

    function 
    stateChanged() 

    if (
    xmlHttp.readyState==4)

    //var com =this.id;
    //document.getElementById(com).innerHTML=xmlHttp.responseText;
    document.getElementById('comments1').innerHTML=xmlHttp.responseText;
    }
    }

    function 
    GetXmlHttpObject()
    {
    var 
    xmlHttp=null;
    try
      {
      
    // Firefox, Opera 8.0+, Safari
      
    xmlHttp=new XMLHttpRequest();
      }
    catch (
    e)
      {
      
    // Internet Explorer
      
    try
        {
        
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
      catch (
    e)
        {
        
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      }
    return 
    xmlHttp;
    }

    In my asp page:
    PHP Code:
    <div id="comments1"></div

  • #2
    Senior Coder ckeyrouz's Avatar
    Join Date
    Jun 2009
    Location
    Montreal, Canada
    Posts
    1,044
    Thanks
    5
    Thanked 179 Times in 179 Posts
    You were told?
    Didn't you even try it?

  • #3
    New to the CF scene
    Join Date
    Jul 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have MIE8 on a Windows Vista Premium.
    I tried Firefox, Chrome and some Chinese browsers too but not all versions of them.

    I wish I could run MIE8 and MIE7 simultaneously on my laptop but MIE8 is considered as an Update (not a program!!!) by Vista...


  • #4
    New to the CF scene
    Join Date
    Jul 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Could someone send me a script that works fine in Internet Explorer 7?
    I want to update the innerHTML of a DIV ID.

  • #5
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    IE8 has the IE7 computability mode on it so you can run IE7 on your machine since it is built into IE8.

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •