Quantcast
Channel: Insulating CDATA value from html - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Insulating CDATA value from html

$
0
0

I have a field in a grid with the following value: "{<dbid>{D7E362F0-2333-4BD0-8159-85E6E26FF6B0}<dbid>}" (see how this is likely also being parsed in your browser), so you don't see the xml tag brackets, value seen below is verbatim straight from the db.

Loaded via ajax like this

<cell style="margin-right:4px;"><![CDATA["{<dbid>{D7E362F0-2333-4BD0-8159-85E6E26FF6B0}<dbid>}"^javascript:OpenAlarmDetail(""{<dbid>{D7E362F0-2333-4BD0-8159-85E6E26FF6B0}<dbid>}"");^_self]]></cell>

The carats are for dhtmlx to create a hyperlink. Though I am using dhtmlx I have not tagged it for dhtmlx, since I don't think this problem necessarily is dhtmlx specific.

The value gets transfered ok, however when displayed in the grid the tags are gone and when I ask for the value of the cell, it now looks like this:

"{<dbid>{3C59E779-57C0-4F48-900E-E2A256E37D2F}<dbid>}"</dbid></dbid>^javascript:OpenAlarmDetail(""{<dbid>{3C59E779-57C0-4F48-900E-E2A256E37D2F}<dbid>}"");^_self

i.e. it now has closing tags attached to it.

How do I insulate my value to prevent it from being parsed further by html, I thought double quotes were supposed to do the trick.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>