I encountered a Javascript error while parsing an XML file. My code looks like this:
var det = eval( "(" + xmlhttp.responseText + ")");
the returned xml file for this code would be :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><accountss><accounts>`<password>1234</password><userid>arjel</userid></accounts></accountss>
I have an unterminated regular expression literal error when executing this code. What could be the problem ?
You are trying to parse XML using an old, slow, dangerous piece of code designed to parse JSON by evaluating it as JavaScript. Unlike JSON, XML is not a subset of JavaScript, so it errors when you try to do this.
Just access
xmlhttp.responseXMLdirectly.