innerHTML not working in IE

Discussion in 'PHP' started by zinalshah, Oct 15, 2010.

  1. #1
    Hi,

    I am having difficulty understanding how innerHTML function works in Internet Explorer.
    I have a link where on click, calls a ajax function and the textresponse of the ajax is set
    i use below code for innerHTML. it's works fine in Mozilla and Chrome But not works in Internet explorer

    document.getElementById("txtHint").innerHTML= document.getElementById("txtHint").innerHTML + xmlhttp.responseText;

    Please help me
     
    zinalshah, Oct 15, 2010 IP
  2. zinalshah

    zinalshah Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Anyone know then Please help me
     
    zinalshah, Oct 16, 2010 IP
  3. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #3
    If your using a name tag both id="txtHint" and name="txtHint" tags must be the same.

    Although the problem might be something else, post your form code for better advice from other members.
     
    MyVodaFone, Oct 16, 2010 IP
  4. pan_zik

    pan_zik Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You have to add browsers detection code in CSS and handle the situation.
     
    pan_zik, Oct 16, 2010 IP
  5. zinalshah

    zinalshah Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I only use id="txtHint"..

    <table id="txtHint" width="100%" border="0" cellspacing="5" cellpadding="0">
    info will be listed here
    </table>

    Click on Add team link then below function call
    function showPlayer(team_id)
    {
    if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
    }
    else
    {// code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function()
    {
    if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("txtHint").innerHTML= document.getElementById("txtHint").innerHTML + xmlhttp.responseText;
    }
    }
    xmlhttp.open("GET","ajaxfile/getplayeredit.php?team_id="+team_id,true);
    xmlhttp.send();
    }

    It's working fine in Mozilla and Chrome But it's not working IE....
    Thank you for reply me
     
    zinalshah, Oct 17, 2010 IP