nbsp Error in Ajax Calls (Mootools) in Google Chrome
Mootools & NBSP; Entity Error Fixed
Posted by Adam Hayes
How to fix 'nbsp' not defined error in Google Chrome.
I have fought with this problem for a long time and finally found a "correct" answer.
If you have problems using MooTools in Chrome and get "Entity 'nbsp' not defined. Below is a rendering of the page up to the first error." I have a great answer for you. All you need to do is change the following code in your mootools.js file:
doc = new DOMParser().parseFromString(root, 'text/xml');
to this
doc = new DOMParser().parseFromString(root, 'text/xhtml');
Just search for "text/xml" (it was the second result for me) and replace it with text/xhtml. That is it. No worrying about doctypes. No worrying about "& #160;" characters. This just fixes it so you can use normal xhtml instead.
Leave Comment