【JavaScript】iframe間(Iframe父頁面和子頁面之間)參數傳遞
假設父頁面(Ex︰A.html),子頁面(Ex︰B.html)。 父頁面(Ex︰A.html) Javascript︰ <script type="text/javascript"> //父回應 function parentResponse(s) { alert('parentResponse---'+s); } //呼叫子 function callchild(s) { window.frames[" childframe "]. childResponse(s) ; } </script> HTML︰ <input name="callChild" type="button" onclick=" callchild('son') ;" value="呼叫子"/> <br/> <iframe src=" B.html " name="childframe" width="100%" marginwidth="0" marginheight="0" scrolling="No" frameborder="0" id=" childframe " ></iframe> ============================================================================================ 子頁面(Ex︰B.html) Javascript︰ <script type="text/javascript"> //子回應 function childResponse(s) { alert('childReponse---'+s); } //呼叫父 function callparent(s) { var frame = wind...