Unwanted cfscript tag in xmlhttlrequest for cfchart in IE

I wanted to refresh whole div containing cfchart with updated chart using simple xmlHttpReq. I simply write another .cfm page having new charts with which i replace chart in my calling .cfm page. It worked fine in Firefox n safari, but i can’t see any updated chart in IE, whole div was blank. There was not even any java script error shown. Problem was that IE inserts tag at the top of html code. So all the html beneath that is not displayed in IE. Below code will solve that purpose.
All it does is replace any found in the xmlHttp.responseText

  if(xmlhttp.readyState == 4 && xmlhttp.status==200)
     var res = xmlhttp.responseText;
     res = res.replace(new RegExp("[<||\>]","gi"),"");
     document.getElementById("charts").innerHTML = res;

Leave a Reply

Your email address will not be published. Required fields are marked *