Vincent
Vincent

Reputation: 16226

HTML5 and <frame> tag

I'm working on the email blast creator app that allows user to build and send HTML emails. Users can enter some data, select a template from the list, click Preview and see the resulting page inside the current page without refresh. I'm using AJAX POST request to submit the data to the server and get the resulting HTML code - full page with <html>, <head> and <body> tags. Before HTML5, I would insert the resulting page into the <frame> tag. for Since the <frame> tag was deprecated in HTML5 how can I display this page inside another? I can't use <iframe src="/preview..."></iframe> because I'm using POST and there's no URL that I can use as iframe's src.

Upvotes: 1

Views: 735

Answers (2)

Lightness Races in Orbit
Lightness Races in Orbit

Reputation: 385395

Keep the iframe blank (with no src) until you have a URI to use. Just like you did with your frame.

Create a page with skeletal content:

<html>
<body>
</body>
</html>

and use that as the iframe's initial page. Then you have a document on which you may perform your DOM manipulation.

Upvotes: 2

quasistoic
quasistoic

Reputation: 4687

Have you considered opening a new window?

Upvotes: 1

Related Questions