小问题:如何把url地址作为参数传递给另一个页面? iframe.location=location.search.split("=")[1] 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <IFRAME id="iframe" WIDTH=300px HEIGHT=300px src="<%=request("src")%>"></IFRAME> to:风云 要JavaScript方式TO:emu按你的方法做了B.htm如下:<html><head><SCRIPT LANGUAGE="JScript">ifr.location=location.search.split("=")[1];</SCRIPT></head><body><IFRAME Name=ifr id=ifr WIDTH=300px HEIGHT=300px></IFRAME></body></html>最后运行是说网页上有错误,没有显示 页面B:<body><IFRAME id="iframe" WIDTH=300px HEIGHT=300px src="c.htm"></IFRAME></body> iframe必须放在函数的上面<IFRAME Name=ifr id=ifr WIDTH=300px HEIGHT=300px></IFRAME><SCRIPT LANGUAGE="JScript">ifr.location=window.location.href.split("=")[1];</SCRIPT> function window_onload() { var g; g=opener.document.all.Form1.hideurl.value document.frames["ifrwin"].location = g; </HEAD> <body MS_POSITIONING="GridLayout" oncontextmenu="return false;" leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" style="OVERFLOW-Y:hidden;OVERFLOW-X:hidden" language="javascript" onload="return window_onload()"> <form id="Form1" method="post" runat="server" onsubmit="return false;"> <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#3a3a84" onfocus="def_set()"> <tr id="aa"> <td> </td> <td > </td> </tr> <tr height="98%"> <td colspan="2"><iframe id="ifrwin" frameborder="0" width="100%" height="100%" scrolling="yes"></iframe> </td> </tr> </table> </form> </body></HTML> } wyfwyf2000(云风) 谢谢调通了 呵呵,照抄书怎么成,要理解呀。<html><head><SCRIPT LANGUAGE="JScript">ifr.location=location.search.split("=")[1];</SCRIPT></head><body><IFRAME Name=ifr id=ifr WIDTH=300px HEIGHT=300px></IFRAME></body></html>先调用了ifr再定义它,当然要出错了。要么给script加defer,要么在onload里面调用,再不然把script挪到iframe下面去。 弹出的疑惑~ with的缺点 XMLSocket为什么发不出去 也接收不到 如何用jquery获取这个里的html div元素 有两个submit按钮,如何回车后提交默认按钮 急求正则 简单字符串问题,不过我不会,在线 怎么限制用户的浏览地址,比如输入http://1.gif,就提示它不能查看。在线等100分 请教:如何得到一个frame的关闭事件? jquery处理复选框的问题 如何在iframe中,刷新或提交parent的窗口 求代码实现红色绿色交替闪烁!
</IFRAME>
按你的方法做了
B.htm如下:
<html>
<head>
<SCRIPT LANGUAGE="JScript">
ifr.location=location.search.split("=")[1];
</SCRIPT>
</head>
<body>
<IFRAME Name=ifr id=ifr WIDTH=300px HEIGHT=300px>
</IFRAME>
</body>
</html>最后运行是说网页上有错误,没有显示
<body>
<IFRAME id="iframe" WIDTH=300px HEIGHT=300px src="c.htm">
</IFRAME>
</body>
<IFRAME Name=ifr id=ifr WIDTH=300px HEIGHT=300px>
</IFRAME>
<SCRIPT LANGUAGE="JScript">
ifr.location=window.location.href.split("=")[1];
</SCRIPT>
var g;
g=opener.document.all.Form1.hideurl.value
document.frames["ifrwin"].location = g;
</HEAD>
<body MS_POSITIONING="GridLayout" oncontextmenu="return false;" leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" style="OVERFLOW-Y:hidden;OVERFLOW-X:hidden" language="javascript" onload="return window_onload()">
<form id="Form1" method="post" runat="server" onsubmit="return false;">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#3a3a84" onfocus="def_set()">
<tr id="aa">
<td> </td>
<td > </td>
</tr>
<tr height="98%">
<td colspan="2"><iframe id="ifrwin" frameborder="0" width="100%" height="100%" scrolling="yes"></iframe>
</td>
</tr>
</table>
</form>
</body>
</HTML> }
调通了
<head>
<SCRIPT LANGUAGE="JScript">
ifr.location=location.search.split("=")[1];
</SCRIPT>
</head>
<body>
<IFRAME Name=ifr id=ifr WIDTH=300px HEIGHT=300px>
</IFRAME>
</body>
</html>先调用了ifr再定义它,当然要出错了。要么给script加defer,要么在onload里面调用,再不然把script挪到iframe下面去。