M. *_*awy 6 html javascript printing web
我想在一个可以在同一页面中调用JS函数的页面上创建一个按钮.该函数需要创建(打开)新窗口,其HTML代码是从JS函数本身提供的.我怎样才能做到这一点?
这样做的目的是从特定页面生成打印友好页面.
请注意:不能使用AJAX.
Fab*_*ger 14
var opened = window.open("");
opened.document.write("<html><head><title>MyTitle</title></head><body>test</body></html>");
Run Code Online (Sandbox Code Playgroud)
var w = window.open("");
w.document.writeln("<the html you wanted to write>")
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
23824 次 |
| 最近记录: |