Afficher un message
Vieux 10/04/2008, 16h33   #1
darrel
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut javascript htmlencode/decode?

I have a function that will insert HTML into a text editor box. It'll look
like this:

editor.insert('my string')

The problem is if mystring has characterts that need to be escaped. ie:

editor.insert('<a href="link">I can't run as well as 'Mr. Mike'. I'm tired
and said "you go without me, mike!"</a>')

The bigger catch is that these strings are going to be rather huge, as they
are giant chunks of HTML (big tables, etc.)

It doesn't look like javascript offers a htmlencode/decode function but does
thave the escape/unescape.

unescape would work fine provided I 'escape' my string first. Anyone know of
a tool, downloadable or online that I can paste in text and have it escaped
for me for use in a javascript?

-Darrel


  Réponse avec citation
 
Page generated in 0,04806 seconds with 9 queries