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

如何为<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.

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

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!