高手指教:链接打开一个新窗体,在新窗口中控制当前窗体如何做到???

moonlight007 2003-10-15 10:39:41
链接打开一个新窗开,在新窗口中控制当前窗体如何做到???
...全文
98 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
moonlight007 2003-10-15
  • 打赏
  • 举报
回复
你们所提供的都是在父窗体对子窗体进行设定,现在的问题是我不能在父窗体进行设置,只能在当子窗体里设置,我只能控制宽,高和位置,要去掉菜单栏,工具栏,地址栏和状态栏怎样做呢????????/
slumcherry 2003-10-15
  • 打赏
  • 举报
回复
http://expert.csdn.net/Expert/topic/2150/2150681.xml?temp=.9382593
moonlight007 2003-10-15
  • 打赏
  • 举报
回复
如果控制新窗口的菜单栏/状态壮/工具栏/地址栏/滚动条等的状态(不显示或显示)
kingdomzhf 2003-10-15
  • 打赏
  • 举报
回复
window.opener
slumcherry 2003-10-15
  • 打赏
  • 举报
回复
opener:::
1.htm
<HTML>
<HEAD>
<TITLE>Master of all Windows</TITLE>
<SCRIPT LANGUAGE="JavaScript1.1">
var myWind
function doNew()
{
if (!myWind || myWind.closed) //attention the condition of "if()"
{
myWind = window.open("opener2.htm","subWindow","HEIGHT=200,WIDTH=350,resizable")
}
else
{
// bring existing subwindow to the front
myWind.focus()
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="input">
Select a color for a new window:
<!--<INPUT TYPE="radio" NAME="color" VALUE="red" >Red-->
<INPUT TYPE="radio" NAME="color" VALUE="yellow">Yellow
<INPUT TYPE="radio" NAME="color" VALUE="blue">Blue
<INPUT TYPE="button" NAME="storage" VALUE="Make a Window" onClick="doNew()">
<HR>
This field will be filled from an entry in another window:
<INPUT TYPE="text" NAME="entry" SIZE=25>
</FORM>
</BODY>
</HTML>


opener2.htm::
<HTML>
<HEAD>
<TITLE>New Window on the Block</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
function getColor()
{
// shorten the reference
colorButtons = self.opener.document.forms[0].color
// see which radio button is checked
for (var i = 0; i<colorButtons.length; i++)
{
if (colorButtons[i].checked)
{
return colorButtons[i].value
}
}

return "white"
}
//-->
</script>
</HEAD>
<!--<SCRIPT LANGUAGE="JavaScript">
document.write("<BODY BGCOLOR='" + getColor() + "'>")
</SCRIPT>-->
<body BGCOLOR="getColor()"> <!--there is the problem-->
<H1>This is a new window.</H1>
<FORM>
<INPUT TYPE="button" VALUE="Who's in the Main window?" onClick="alert(self.opener.document.title)">
Type text here for the main window:
<INPUT TYPE="text" SIZE=25 onChange="self.opener.document.forms[0].entry.value = this.value"><!--attention "this.vlaue"-->
</FORM>
</BODY>
</HTML>



87,901

社区成员

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

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