|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
> 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? Or, perhaps a different way to solve this... If I have this string: <table id="gatewaytable"< Is there a prebuilt function in javascript to 'unencode' the html entities so it inserts this: <table id="gatewaytable"> Or would one have to write their own script to manually replace the html entities? -Darrel |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
>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? Spoke too soon. Found one: http://www.the-art-of-web.com/javascript/escape/ -Darrel |
|
![]() |
| Outils de la discussion | |
|
|