on 2019 Apr 26 11:16 AM
Hi All,
do you know if it's possible to decode an HTML string with XSJS?
I mean for example from $lt;mytag$gt; to <mytag> (replace $ with & otherwise it convert to text)
I found this library $.util.codec but don't contains nothing about HTML.
Gennaro
Request clarification before answering.
I do not know a functionality/lib which is shipped with XS Classic to do HTML string escaping/unescaping. But you can create your own library providing that functionality.
Create a new xsjslib file e.g. utils.xsjslib in a package (e.g. tools) and paste following coding into it (sorry for the screenshot, but the code plugin coverts escaped character sequences). This library provides the functions escapeHtml and unescapeHtml for escaping/unescaping:
To use the library, just import it to your xsjs file and call the functions, e.g.
The example creates following result:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
49 | |
6 | |
5 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.