日期:2014-05-18  浏览次数:20652 次

父页面如何给它里面的iframe页面传值
完成一个查询的功能。查询结果在iframe页面显示。
      请指教!

------解决方案--------------------
父页面调用ifream的方法: document.frames( "iframename ").functionName();
iframe调用父页的方法:parent.functionName();
------解决方案--------------------
<iframe id= "showArticle " name= "showArticlename " scrolling= "no " src= "loading.html " width= "90% " height= "100% " frameborder= "0 "> </iframe>

<form name= "keyform " action= "search.asp " method= "post " target= "showArticlename ">
------解决方案--------------------
<form name= "keyform " action= "search.jsp " method= "post " target= "showArticlename ">
<input type= "submit " value= "search ">
</form>

<iframe id= "showArticle " name= "showArticlename " src= "loading.jsp " width= "90% " height= "100% " frameborder= "0 ">
</iframe>

上面的form,一提交,search.jsp用来查询显示结果,它就是显示在iframe里面,正是你要的嘛,这不就是例子?