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~~
...全文
83 9 打赏 收藏 举报
写回复
9 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
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);
发帖
JavaScript

8.7w+

社区成员

Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
帖子事件
创建了帖子
2004-10-21 03:34
社区公告
暂无公告