谁能接下此招,必有重谢。

whb959358 2001-06-07 09:45:00
我在一个窗口中按下一个按钮后,弹出一个新的窗口,我如何在第一个窗口中提取新窗口的源文件,通过javascript处理,得到我需要的内容。既对新窗口的html处理,生成里另外一个我需要的页面。
...全文
68 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
whb959358 2001-06-07
  • 打赏
  • 举报
回复
thank you very much.
whb959358 2001-06-07
  • 打赏
  • 举报
回复
very good .给分
孟子E章 2001-06-07
  • 打赏
  • 举报
回复
从头到尾都看到啦!!!!
孟子E章 2001-06-07
  • 打赏
  • 举报
回复
好啦!!完整的解决方案来啦!!!
=========================
<script>
var aa=window.open("动画.htm")
function test(){
alert(aa.document.documentElement.outerHTML)
}
</script>
<input type=button onclick="test()" value="只能得到<body> </body>之间的代码。得到新窗口代码!">


动画.htm
==========

<script>
var tmId;
function moveit(){
if((parseInt(document.all.mxh.style.left))>300)
{
document.all.mxh.style.left="0";
document.all.mxh.style.top="0";
}
else
{
document.all.mxh.style.left=(parseInt(document.all.mxh.style.left)+3).toString()+"px"
document.all.mxh.style.top=(parseInt(document.all.mxh.style.top)+3).toString()+"px"
}
tmId=setTimeout('moveit()',20)
}

</script>
<body onload="moveit()" bgcolor="#0099ff">
<div id=mxh style="position:absolute;left:0px;top:0px"><a href="http://lucky.myrice.com" target="_blank"><img src="http://lucky.myrice.com/javabk1.jpg" onmouseover="window.clearTimeout(tmId)" onmouseout="window.setTimeout('moveit()',20)" border=0></a></div>

孟子E章 2001-06-07
  • 打赏
  • 举报
回复
<body>标记也可以得到!
<script>
var aa=window.open("动画.htm")
function test(){
alert(aa.document.body.outerHTML)
}
</script>
<input type=button onclick="test()" value="只能得到<body> </body>(含body标记)之间的代码。得到新窗口代码!">

动画.htm
====================

<script>
var tmId;
function moveit(){
if((parseInt(document.all.mxh.style.left))>300)
{
document.all.mxh.style.left="0";
document.all.mxh.style.top="0";
}
else
{
document.all.mxh.style.left=(parseInt(document.all.mxh.style.left)+3).toString()+"px"
document.all.mxh.style.top=(parseInt(document.all.mxh.style.top)+3).toString()+"px"
}
tmId=setTimeout('moveit()',20)
}

</script>
<body onload="moveit()" bgcolor="#0099ff">
<div id=mxh style="position:absolute;left:0px;top:0px"><a href="http://lucky.myrice.com" target="_blank"><img src="http://lucky.myrice.com/javabk1.jpg" onmouseover="window.clearTimeout(tmId)" onmouseout="window.setTimeout('moveit()',20)" border=0></a></div>
孟子E章 2001-06-07
  • 打赏
  • 举报
回复
<script>
var aa=window.open("动画.htm")
function test(){
alert(aa.document.body.innerHTML)
}
</script>
<input type=button onclick="test()" value="只能得到<body> </body>之间的代码。得到新窗口代码!">

动画.htm
====================

<script>
var tmId;
function moveit(){
if((parseInt(document.all.mxh.style.left))>300)
{
document.all.mxh.style.left="0";
document.all.mxh.style.top="0";
}
else
{
document.all.mxh.style.left=(parseInt(document.all.mxh.style.left)+3).toString()+"px"
document.all.mxh.style.top=(parseInt(document.all.mxh.style.top)+3).toString()+"px"
}
tmId=setTimeout('moveit()',20)
}

</script>
<body onload="moveit()" bgcolor="#0099ff">
<div id=mxh style="position:absolute;left:0px;top:0px"><a href="http://lucky.myrice.com" target="_blank"><img src="http://lucky.myrice.com/javabk1.jpg" onmouseover="window.clearTimeout(tmId)" onmouseout="window.setTimeout('moveit()',20)" border=0></a></div>

87,910

社区成员

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

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