Ajax response handler breaks Javascript
-
The ajax response handler does $data = $(documentHtml(data)).
However, when using $(html_string), jQuery sees every ‘<‘ sign in the string as a HTML opening tag, therefore the ‘less then’ sign breaks javascript code.
Solution:
var el = document.createElement('html').innerHTML; el.innerHTML = documentHtml(data); var $data = $(el);
Cheers, Martien
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Ajax response handler breaks Javascript’ is closed to new replies.