Reputation: 3350
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.
Upvotes: 0
Views: 54
Reputation: 96151
CDATA is an XML “feature”, it has no meaning when your content is parsed as HTML.
If the sole purpose here is to have the “tags” not to be interpreted as such by the browser, then write <
and >
as <
and >
.
Upvotes: 2