why?????please help me~~~~~~~~~~~~``

tooogoooo 2004-10-21 03:34:47
a.aspx:
<IMG id="Img1" style="Z-INDEX: 103; LEFT: 464px; WIDTH: 96px; POSITION: absolute; TOP: 40px; HEIGHT: 72px" height="72" alt="" src="" width="96">
<IMG id="Img2" style="Z-INDEX: 105; LEFT: 584px; WIDTH: 96px; POSITION: absolute; TOP: 152px; HEIGHT: 72px" height="72" alt="" src="" width="96">
<IMG id="Img3" style="Z-INDEX: 106; LEFT: 456px; WIDTH: 96px; POSITION: absolute; TOP: 248px; HEIGHT: 72px" height="72" alt="" src="" width="96">
<INPUT onclick="window.open('b.aspx','aa','width=380,height=420,left=320,top=150')" style="Z-INDEX: 100; LEFT: 376px; POSITION: absolute; TOP: 224px" type="button" value="Button">

b.aspx
<body>
<script>
alert(parent.document.all.Img1);
</script>
</body>

why.......alert(parent.document.all.Img1) is undefined?
how can i get the Img1 in b.aspx??? please help me~~
...全文
92 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
tooogoooo 2004-10-21
  • 打赏
  • 举报
回复
3Q,i see
DeltaCat 2004-10-21
  • 打赏
  • 举报
回复
before you call an object, it must have been loaded, so place the scripts below the object
DeltaCat 2004-10-21
  • 打赏
  • 举报
回复
b.aspx:

<DIV id="box" style="Z-INDEX: 102; LEFT: 0px; WIDTH: 380px; POSITION: absolute; TOP: 64px; HEIGHT: 385px" ms_positioning="GridLayout"></DIV>

<script>
alert(document.getElementById("box"));
</script>
tooogoooo 2004-10-21
  • 打赏
  • 举报
回复
。。。。你没明白我的意思?我的意思是当b页面为新打开的页面时alert(document.all.box)为undefined。box是b页面的控件ID
vc_pioneer 2004-10-21
  • 打赏
  • 举报
回复
直接使用box取得对象
tooogoooo 2004-10-21
  • 打赏
  • 举报
回复
help~~~~~~~~~~
tooogoooo 2004-10-21
  • 打赏
  • 举报
回复
b.aspx:
<script>
alert(document.getElementById("box"));
</script>
<DIV id="box" style="Z-INDEX: 102; LEFT: 0px; WIDTH: 380px; POSITION: absolute; TOP: 64px; HEIGHT: 385px" ms_positioning="GridLayout"></DIV>

why........alert(document.getElementById("box")) is null??please~~
tooogoooo 2004-10-21
  • 打赏
  • 举报
回复
thank you~`
这个问题能解决么?
http://community.csdn.net/Expert/topic/3477/3477729.xml?temp=.8885462
DeltaCat 2004-10-21
  • 打赏
  • 举报
回复
TRY:

alert(window.opener.document.all.Img1);

87,907

社区成员

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

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