请问如何在打开一个框架页面的窗口中再改变框架页面中一个frame的src a.html中window.open(rul,"mainFrame")OR<a href="http://xxx" target="mainFrame">123</a> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Sorry, url not rulwindow.open(url,"mainFrame","") <a href="" target=""></a> 不对啊!我是这样的,a.html是一个普通页面,从a.html页面打开b.html(新窗口中),b.html是主框架页面,其中有三个框架页面分topFrame,mainFrame,buttomFrame.我想在a.html中动态的指定mainFrame中装载的链接。 a.html:<script>window.open("b.html");</script><a href="http://www.csdn.net/" target="mainFrame">csdn</a><a href="#" onclick="window.open('http://www.csdn.net/','mainFrame')">csdn</a>b.html:<frameset rows="30,100%,30" cols="*" framespacing="0" frameborder="no" bordercolor="#000000" style="border:1px solid WindowText;"> <frame src="topFrame.htm" name="topFrame" scrolling="NO" noresize="true" > <frame src="mainFrame1.html" name="mainFrame" id="mainFrame" scrolling="NO"> <frame srcbuttomFrame.htm" name="bottomFrame" scrolling="NO" noresize="true"></frameset> 不是这样的。b.html是一个多用途的框架页面。我要根据需要打开b.html,但每次mainFrame调用的是不同页面,而不是b.html页面一直开着的。 a.html:<script>var newwin=window.open("temp.htm");newwin.document.frames("mainFrame").location.href="http://www.csdn.net/"</script>b.html:<frameset rows="30,100%,30" cols="*" framespacing="0" frameborder="no" bordercolor="#000000" style="border:1px solid WindowText;"> <frame src="topFrame.htm" name="topFrame" scrolling="NO" noresize="true" > <frame src="mainFrame1.html" name="mainFrame" id="mainFrame" scrolling="NO"> <frame srcbuttomFrame.htm" name="bottomFrame" scrolling="NO" noresize="true"></frameset> a.html:<script>var newwin=window.open("b.html");newwin.document.frames("mainFrame").location="http://www.csdn.net/"</script>b.html:<frameset rows="30,100%,30" cols="*" framespacing="0" frameborder="no" bordercolor="#000000" style="border:1px solid WindowText;"> <frame src="topFrame.htm" name="topFrame" scrolling="NO" noresize="true" > <frame src="mainFrame1.html" name="mainFrame" id="mainFrame" scrolling="NO"> <frame srcbuttomFrame.htm" name="bottomFrame" scrolling="NO" noresize="true"></frameset> 不行,提示发生意外!查看了一下,好象是window对象是生成了,但mainFrame对象还没生成!我想到一个方法,就是在a中用js写出b中html代码。但感觉上好象更麻烦! 还有办法,就是调用两次window.open第一次打开b.html:window.open("b.html");第二次:window.open("http://www.csdn.net","mainFrame");这样就可以了。大家看如何? 你先检测一下b.html是否加载再执行就不会出错了 那就使用window.open("b.html?url=http://www.csdn.net");在b.html获得这个url,然后再重新写入整个frameset 请教各位,利用 JS 导出(创建) word,速度太慢问题! JS问题求助 这样的JS怎么写. js 数组中删除一个元素 一个网页嵌入另一个网页的问题 请高人写一个二级连动的下拉列表并计算结果 出100分 关于gif图片的显示问题 问一个页面载入的问题,请高手指点一二。。。。。。。。。。。 josn有子对象的时候josn字符串怎么写,jquery怎么读呀 再问,一个OPEN问题 如何在网页中调用另一个*.js文件中的方法 一个js文件我怎么也看不懂,还请各位高手赐教
b.html是主框架页面,其中有三个框架页面分topFrame,mainFrame,buttomFrame.我想在a.html中动态的指定mainFrame中装载的链接。
window.open("b.html");
</script>
<a href="http://www.csdn.net/" target="mainFrame">csdn</a>
<a href="#" onclick="window.open('http://www.csdn.net/','mainFrame')">csdn</a>
b.html:<frameset rows="30,100%,30" cols="*" framespacing="0" frameborder="no" bordercolor="#000000" style="border:1px solid WindowText;">
<frame src="topFrame.htm" name="topFrame" scrolling="NO" noresize="true" >
<frame src="mainFrame1.html" name="mainFrame" id="mainFrame" scrolling="NO">
<frame srcbuttomFrame.htm" name="bottomFrame" scrolling="NO" noresize="true">
</frameset>
b.html是一个多用途的框架页面。我要根据需要打开b.html,但每次mainFrame调用的是不同页面,而不是b.html页面一直开着的。
var newwin=window.open("temp.htm");
newwin.document.frames("mainFrame").location.href="http://www.csdn.net/"
</script>b.html:<frameset rows="30,100%,30" cols="*" framespacing="0" frameborder="no" bordercolor="#000000" style="border:1px solid WindowText;">
<frame src="topFrame.htm" name="topFrame" scrolling="NO" noresize="true" >
<frame src="mainFrame1.html" name="mainFrame" id="mainFrame" scrolling="NO">
<frame srcbuttomFrame.htm" name="bottomFrame" scrolling="NO" noresize="true">
</frameset>
var newwin=window.open("b.html");
newwin.document.frames("mainFrame").location="http://www.csdn.net/"
</script>b.html:<frameset rows="30,100%,30" cols="*" framespacing="0" frameborder="no" bordercolor="#000000" style="border:1px solid WindowText;">
<frame src="topFrame.htm" name="topFrame" scrolling="NO" noresize="true" >
<frame src="mainFrame1.html" name="mainFrame" id="mainFrame" scrolling="NO">
<frame srcbuttomFrame.htm" name="bottomFrame" scrolling="NO" noresize="true">
</frameset>
我想到一个方法,就是在a中用js写出b中html代码。但感觉上好象更麻烦!
第一次打开b.html:
window.open("b.html");
第二次:
window.open("http://www.csdn.net","mainFrame");
这样就可以了。
大家看如何?