I’m building a web application where the user can supply a bit of his own html and it should be inserted into one of the page’s div elements. My only concern is if the user supplies some really awful code. How do I ‘sandbox’ his html code so that, if it really is that bad, it won’t derail the rest of the page’s layout?
Share
With an
<iframe sandbox="">. There isn’t really any other reliable way.