0

I am working on porting a legacy application (runs on IE 6/compatibility) using jQueryMobile. In the legacy app, they let the user use HTML to format their text for display. I understand that when rendered, they use iFrames so that when the user's HTML doesn't break the whole page (and lose navigation controls etc..,) So the HTML is not always 'clean', but only messes up display in a localized way.

I'm looking for a widget or something that I can pass it a string that may or may not be good HTML, and it will contain any display problems to that area and not break the whole page.

Every user able to enter the HTML has to log into the system, and all changes are logged by user, so we are not concerned about them trying to enter malicious HTML, we just want to protect them from honest mistakes and 'really old' deprecated HTML. And because we run offline (appcache/local database) we don't want to force them to go back to the server and reload data just because they made a mistake with their HTML.

  • Why not continue using iFrames? Seems like a good way to sandbox the possibly bad HTML... – ezanker Jan 22 '14 at 19:48
  • ezanker, I guess my (first?) problem might be that I don't know how to, with jQueryMobile and knockout, get the user HTML string bound to the srcdoc= attribute of the iFrame. The method the legacy system did won't work because it just created pages on the fly (src=) that could be queried by the server, We're using appcache and data in the local database that I want to bind to the srcdoc= on the client side when there is no internet connection. I'll try a bit here and comment further if I figure it out. – Peter John Horwood Jan 23 '14 at 00:38
  • Could you write the HTML to a localStorage variable and then load a page in the iFrame that always reads the HTML from that localStorage location? Also, you can write directly to iFrame document: http://stackoverflow.com/questions/10418644/creating-an-iframe-with-given-html-dynamically – ezanker Jan 23 '14 at 15:04

0 Answers0