0

My javascript code has used innerHTML for changing value in a table list dynamically.

However, I’ve checked IE11 doesn’t let intterHTML to change table value.

Does anyone know the alternative way to change list value in a table instead of innerHTML?

And also could you show me a sample code?

This is a part of my code.

<script type="text/javascript">
 /*repeating following process for list_A and list_B*/
   var request = new XMLHttpRequest();
   request.open("GET", "listValues.php", false ); 
   request.send(null);
   document.getElementById("list_"+ tableType).innerHTML=request.responseText ;  
 //tableType above must be list name A or B//

</script>   
<body>   
<table color='glay' highth='256'>  
    <tr/>
        <td/ width=64><p id =" list_A" ></p>  
        <td/ width=64><p id =" list_B" ></p>  
</table>
</body>
user1345414
  • 3,745
  • 9
  • 36
  • 56
  • probably duplicated http://stackoverflow.com/questions/25969386/innerhtml-doesnt-work-in-ie11-and-ie8 – alebruck May 14 '15 at 02:52
  • innerHTML has worked 100% correctly in IE since ie10, no worries... – dandavis May 14 '15 at 03:31
  • @dandavis.If the part `

    ` is placed before `` tag, it will be able to change as you said. However, it won’t be able to change if the target is in a table on IE11. I want to know is how to change list value in a TABLE.
    – user1345414 May 14 '15 at 04:18
  • is that your markup? it's invalid and doesn't result in the structure or IDs that you might be thinking it would. you can change the innerHTML of an element by ID at any time, no matter the container. – dandavis May 14 '15 at 04:22
  • Why is your `td` outside of your `tr`? (hint, the `tr` is auto closed by the trailing `/` so your `td` is outside of it) Why do you have an illegal `/` after `td`? Why are your `td` not closed? – slebetman May 14 '15 at 04:27

1 Answers1

0

You can try the following

$("list_"+ tableType).html(request.responseText);

Deepak
  • 112
  • 10
  • Sorry, It doesn’t work. Could you tell me this syntax? – user1345414 May 14 '15 at 05:18
  • just try by replacing this line of code document.getElementById("list_"+ tableType).innerHTML=request.responseText ; with $("#list_"+ tableType).html(request.responseText); – Deepak May 14 '15 at 06:19