dqeq885710
dqeq885710
2015-06-03 19:13
浏览 225

如何为<iframe>动态创建HTML页面?

Searching for possibilities the only viable option I found for generating an HTML file was the following snippet:

$file="name.html";
$fh = fopen($file, 'w'); //or w+
$stringOfHTML = "everything we want on the webpage";
fwrite = ($fh, $stringOfHTML);

While this is exactly what I want, it will not work within the bounds I have. Since I'm using Parse.com I cannot host any PHP scripts, and anything that is not supported by all major browsers is immediately out of the question.

Is there anything equivalent to this, that would work with a static host like Parse.com?

E: After looking through fsacer's response and links from those, it's become clear to me that I don't just want to dynamically interpret a string as an HTML page.

What I am looking for is to actually generate an HTML file using JavaScript(if possible) THEN set that as the iframe's source.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douqi4673
    douqi4673 2015-06-03 19:19
    已采纳

    I guess you could put together this with (jquery) ajax and set src.

    点赞 评论

相关推荐