javascript - In IE11, XML DOM node is broken down into multiple children based on white-space -
the existing code mades ajax call server. on success this:
var result = transport.responsexml.getelementsbytagname('contents')[0].firstchild.nodevalue; ...process result
previously working fine in chrome , ff (and thought versions of ie well), realized in ie11 there strange behavior happening firstchild.nodevalue
contains expected content line break/white space characters.
so result of firstchild.nodevalue
<!doctype html ><!
. , instead of 1 child node, there many of them, , seems happen in ie.
in chrome developer tools, when put breakpoint on success call, result of transport.responsexml.getelementsbytagname('contents')[0]
looks like:
<contents> <![cdata[ <!doctype html ><!-- comment --> ...actual expected content here. ]]> </contents>
however in ie11 developer tools looks like:
<contents> <!doctype html ><! -- comment -- > ...actual expected content here. <contents>
am doing wrong when processing returned on success? there better way retrieve content looking in way compatible both ie , 'the rest'?
Comments
Post a Comment