rarebit Posted October 11, 2008 Share Posted October 11, 2008 I can't seem to output the & sign to generate html escape ':' ... s = s.replace(/::/g, '::'); I've tried along these lines and others: s = s.replace(/::/g, String.fromCharCode(38)+'#58;'); Edit reason: no amps Quote Link to comment Share on other sites More sharing options...
Psycho Posted October 11, 2008 Share Posted October 11, 2008 Your codes are wrong. & is the ampersign : is the colon This '::' will result in this: '::' I think you want this: s = s.replace(/::/g, '::'); Quote Link to comment Share on other sites More sharing options...
rarebit Posted October 11, 2008 Author Share Posted October 11, 2008 no, I've solved it with: s = s.replace(/&/g, escape('&')+'amp;'); p.s. preview your code, I think it's not what you intended... cheers though... Quote Link to comment Share on other sites More sharing options...
Psycho Posted October 11, 2008 Share Posted October 11, 2008 p.s. preview your code, I think it's not what you intended... cheers though... LOL, the escape codes were parsed by the forum. I would have thought that would be handled - especially within code tags. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.