开发者

Storing HTML in datastore and Decoding during XSL transformation

I'm trying to store html object tags for video players in a datastore. This data will be serialized and passed back to client javascript where it will be transfor开发者_开发百科med and displayed in the browser to show the video. I need to be able to htmlDecode the data so that it is evaluated properly in the browser.

Any ideas how to accomplish this in javascript?


Grab your HTML code and run through one of the methods described in this article (I had good results with encodeURI). When ready to use - run it through the compatible decode method


One of my co-workers suggested the following solution:

http://www.strictly-software.com/htmlencode

This is a set of javascript libraries to encode and decode html.


Why not use the following method?

HttpUtility.HtmlEncode(...)

And then on the JavaScript side, use the following.

unescape(theEncodedHtml)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜