页面2.html中有一个iframe,这个iframe里面有产品的记录列表,请问在iframe中进行浏览后怎样才能像普通页面那样返回1.html? 可以在返回钮上加入如下脚本的:<button onclick="javascript:location='1.htm';">只有一个按钮是不能有什么反应的. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1.htm的URL可能很长而且是动态字符串组合的。请问还有其它简便的方法吗? 先由ifarme的TOP属性,将数据返回到2.html,再由2.html的opener属性返回到1.html即可!在2.html中需要一个返回按钮。iframe中,可绑定点击事件,将数据返回到2.html。 在iframe中如何实现绑定点击事件??? <button onclick="top.location=document.referrer">Back</button> <a onclick="dosomething('returnStr');">点击这儿做某事 </a><script language="javascript">function dosomething(tmpstr){ window.top.document.form1.text1.value=tmpstr;//点击时将数据返回到TOP窗口的FORM1表单的文本框TEXT1。}</script>在2.html中:<input type=button value="返回" onclick="dosomething();"><form name=form1 id=form1><input type=text name=text1 value=""></form><script language=javascript>function dosomething{ window.opener.document.mainform.text1.value=form1.text1.value; //将2.html的值返回到1.html ,并关闭2.html …… self.close();}</script>1.html<form name=mainform> <input type=text name=text1> ……</form> 各位看清楚我的问题哟!我的问题是iframe中已经生成了记录列表,在iframe中浏览分页列表后,地址已经改变,然后在父页面即2.html中单击“返回”按钮。问题不是你们想象得那么简单! JS动态添加表单元素后无法取值 JavaScript循环定时器问题 jQuery的问题 如何获取select选中某项的值?不是通过表单 一个逻辑错误。高手指点一下阿 请牛人帮我注视下代码,ajax的不懂啊 关于attchEvent~~~~~~~~~~~ 问一个关于<!--的JS问题 巨巨初级的问题 高分送出 请大神帮忙,改写成鼠标事件,滑入变黑色,滑出变白色 求教:在网页中弹出一新窗口,而新窗口不在最上边 怎样使下拉框中的<option>aaa</option>居中显示?其它几项很长,第一项aaa靠在左侧太难看了!能否让aaa居中?
请问还有其它简便的方法吗?
function dosomething(tmpstr){
window.top.document.form1.text1.value=tmpstr;//点击时将数据返回到TOP窗口的FORM1表单的文本框TEXT1。
}
</script>在2.html中:<input type=button value="返回" onclick="dosomething();">
<form name=form1 id=form1>
<input type=text name=text1 value="">
</form>
<script language=javascript>
function dosomething{
window.opener.document.mainform.text1.value=form1.text1.value; //将2.html的值返回到1.html ,并关闭2.html
……
self.close();
}
</script>1.html
<form name=mainform>
<input type=text name=text1>
……
</form>