日期:2014-05-16  浏览次数:20355 次

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();
    }
?