Jquery .html() Remove Line Break On Ie 8
So I've been trying to decode string with .html() function in jQuery and it work really nice except on IE... Here is the string I have: ééé\r\nà
Solution 1:
Try This:
var itemDescription = "ééé\\r\\nààà";
Solution 2:
Actually one solution I found is to do something like that:
itemDescription = itemDescription.replace(/(\r\n|\r|\n)/g, '________BREAK________');
var decodedDescription = $("<div>").html(itemDescription).text();
decodedDescription = decodedDescription.replace(/________BREAK________/g, '\r\n');
Post a Comment for "Jquery .html() Remove Line Break On Ie 8"