How can I trim all spaces from a string even if they are caused by non-breaking spaces ( )
For instance:
var foo = $.trim($('<p> foo </p>').text());
Foo value " foo "instead"foo"
UPDATE
So the problem was not a jQuery trim function. It works great. The problem is the MSAjax trim function. jQuery, by right, uses function detection and, if they do not exist, uses its implementation.
Unfortunately, the MSAJax trim implementation does not break char 160 (without a break). However, regex jQuery alignment does, as it understands that IE does not include char 160 in \ s.
Why do stupid browser problems always end up with M $ implementing something ???
source
share