如何用Java Script生成一个全新的页面并显示?

qyh 2001-08-05 08:40:58
如何用Java Script生成一个全新的页面并显示?不要在新窗口中显示。
...全文
290 8 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
qqroom 2001-08-16
  • 打赏
  • 举报
回复
er
seal_kh 2001-08-14
  • 打赏
  • 举报
回复
<html>
<head>
<script language="javascript">
function newHtml() {
document.write("<html><body>hehe</body></html>");
}
</script>
</head>
<body>
<input type="button" onclick="newHtml()" value="New">
</body>
</html>
blues-star 2001-08-14
  • 打赏
  • 举报
回复
建议你用重定向好啦~

<script language=javascript>
location = "新页面的URL";
</script>
eachhelp 2001-08-13
  • 打赏
  • 举报
回复
直接用open("","window title","一些参数“)
document.write("你想要写的东西”);
孟子E章 2001-08-05
  • 打赏
  • 举报
回复
<HTML>
<body id=mxh>
测试文字
<script>
function test(){
var str=""
str+='<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>'
str+='<body><p style="color:#ff0000">new page content<p></body>'
document.all.mxh.innerHTML=str
}
</script>
<input type=button value="产生新页面" onclick="test()">
</HTML>
「已注销」 2001-08-05
  • 打赏
  • 举报
回复
那就先打开窗口

然后用JS往新的窗口里写东西呀


@_@
qyh 2001-08-05
  • 打赏
  • 举报
回复
不要在新窗口中显示。
qyh 2001-08-05
  • 打赏
  • 举报
回复
新的页面中的
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
之类的东西都用Java Script生成。
怎么办??????

87,997

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧