Javscript調用iframe框架頁面中函數的方法


Javscript調用iframe框架頁面中函數的方法,可以實現iframe之間傳值或修改值了,

訪問iframe里面的函數:

window.frames['CallCenter_iframe'].hw_CallIn(callerid,sessionid);

說明:
CallCenter_iframe為iframe的id
hw_CallIn為iframe中頁面中的方法名
callerid和sessionid為方法中的參數
例子如下:
index.html
<a href="#" onclick="window.frames['frame1'].MyNext()">aa</a>
<iframe id="frame1" src="2.html" ></iframe>

  2.html

<script language="javascript" type="text/javascript">
 function MyNext()
 {
   alert(1);
 }
</script>

原文:http://www.jb51.net/article/56988.htm


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM