1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > html返回首页页面代码 后台返回的HTML整个页面代码打开方法

html返回首页页面代码 后台返回的HTML整个页面代码打开方法

时间:2022-11-27 10:48:23

相关推荐

html返回首页页面代码 后台返回的HTML整个页面代码打开方法

后台返回的html代码片段,需要插入html标签中,而返回的整个html文档,则需要重写整个页面。

解决方法:

需要一个中转页面,用document.write()方法重写整个页面;

// POST任意内容并跳转function StandardPost(html) {localStorage.removeItem('callbackHTML');localStorage.setItem('callbackHTML',html);window.location.href = window.location.href.split('/pages/')[0] + '/pages/account/call_back.html';}

call_back.html页面:

<script>document.write(localStorage.getItem('callbackHTML'));document.close();</script>

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。