dqeq885710 2015-06-03 19:13
浏览 395
已采纳

如何为<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 2015-06-03 19:19
    关注

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?