quote:
Originally posted by mickael9
code:
var htmlentities = {
'"' : '"',
' ' : ' ',
''' : '\'',
'&' : '&',
'\\\'' : '\''
}
multiply that list be several thousand possible entities and you have your complete script.
Otherwise such a function will always leave some entities behind.
Just to say that making something like this requires a extremely huge list...
With the result that your for...loop and the use of an object creator for each element is going to slow down your script a hell of a lot.
For situations like this, I suggest you actually dish regular expressions and make your own string manipulation routines.
Or better yet, use existing ActiveX objects which might do this job for you (I'm thinking about the XML object and that stuff)