Welcome Guest, Not a member yet? Register   Sign In
javascript confirmation with html character code
#2

[eluser]drewbee[/eluser]
Even though it is an entity, javascript still interprets it as a single quote. You still need to make sure you are escaping the entity version of it with a backslash.

Code:
var string = 'ampersand & woot & and &<';
    string = string.replace(/&/gi,'\&');
    alert(string);


Messages In This Thread
javascript confirmation with html character code - by El Forum - 05-26-2009, 07:54 AM
javascript confirmation with html character code - by El Forum - 05-26-2009, 11:38 AM
javascript confirmation with html character code - by El Forum - 05-26-2009, 11:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB