读书人

JS 在open打开的窗口中调用父页面JS步

发布时间: 2012-10-31 14:37:31 作者: rapoo

JS 在open打开的窗口中调用父页面JS方法

父窗口的弹出:

?

    function uploadImgFile(id){        window.open("${base}/ajax/picupload.action?parentImgUrlId="+id,"","height=300, width=500, toolbar =no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no");        //document.getElementById(id).value = someValue;    }function testfun(aaa){alert("111+"+aaa);}
?

?

?

?

在open 的窗口中调用

?

    function setParentImgUrl(){    window.opener.testfun('aaaaa');        //window.opener.document.getElementById("${parentImgUrlId}").value = document.getElementById('img_url').value;        window.close();    }
?

读书人网 >JavaScript

热点推荐