I'm trying to parse an AJAX response and get the id of the body tag. I can't do this via jQuery, though, because jQuery can't emulate a DOM response for a body tag.
I've split this into many lines to try and isolate the error. This works in modern browsers, but it's failing in IE8.
var bodyIDregex = new RegExp(/<body[^>]*id=["'](.*?)["']>/gi),
matched = html.match(bodyIDregex),
bodyID = bodyIDregex.exec(matched[0]);
bodyID = bodyID[1];
I have confirmed that the value of the variable html is as expected.
Any help?
Thanks!
See Question&Answers more detail:os