innerHTML doesn't interpret HTML tags
I'm trying to replace the contents of a div with some piece of HTML. However the html is not interpreted. If error[0].childNodes[0].nodeValue
contains blah <strong>foobar</strong>
then I will see <strong>
in the output. How can I fix this?
document.getElemen开发者_如何学PythontById("booking").innerHTML = "Server error: " + error[0].childNodes[0].nodeValue;
Is perhaps error[0].childNodes[0].nodeValue
escaped? you could try:
document.getElementById("booking").innerHTML = "Server error: " + unescape(error[0].childNodes[0].nodeValue);
精彩评论