After some research I found the simple solution to convert HTML characters entities back to regular text using JavaScript. The code is simple and fast.

var decodeEntities = function( s )
{
	var str, temp = document.createElement('p');
	temp.innerHTML = s;
	str = temp.textContent || temp.innerText;
	temp = null;
	return str;
};
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Comments

You can leave a response, or trackback from your own site.

Before you add comment see for rules.

Leave a Reply

Your email address will not be published. Required fields are marked *

2a2y9d