插入HTML后在JavaScript中打开窗口 [英] Open window in JavaScript with HTML inserted
本文介绍了插入HTML后在JavaScript中打开窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在JavaScript中打开一个新窗口并插入HTML数据而不是仅链接到HTML文件?
解决方案
您可以使用 window.open 打开新的窗口/选项卡(根据浏览器设置)在JavaScript中。
通过使用 document.write ,您可以将HTML内容写入打开的窗口。
How would I open a new window in JavaScript and insert HTML data instead of just linking to an HTML file?
解决方案
You can use window.open to open a new window/tab(according to browser setting) in javascript.
By using document.write you can write HTML content to the opened window.
这篇关于插入HTML后在JavaScript中打开窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文