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

JavaScrip高手过来帮忙看看!
JScript code


var oPopup = window.createPopup();    
    function setFzr(){

        //var oMessage=document.all("oMessage");
        with (oPopup.document.body) {
            style.backgroundColor="F3F9FC";
            style.border="solid black 1px";
            innerHTML="<table width='100%' border='0' align='center' cellpadding='1' cellspacing='1' bgcolor='F3F9FC'><tr>"
            +"<td bgcolor='9FCAF2' align='center'>姓    名</td>"
            +"<td><input type='text'></td></tr>"                        +"<tr><td><input type='button' value='确定' onclick='closefzr()'></td></tr></table>";
        }
            //var element = document.getElementById("fzr");
            oPopup.show(0,25,300,250);
        
    }





------解决方案--------------------
ok了


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="zourinet">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">

</HEAD>

<BODY>
<form method="post" action="">
<div>
<script language="JavaScript">
/* <![CDATA[ */
function callTest(){alert('is called');}

var oPopup = window.createPopup();
function setFzr(){

//var oMessage=document.all("oMessage");
with (oPopup.document.body) {
style.backgroundColor="F3F9FC";
style.border="solid black 1px";
innerHTML="<table width='100%' border='0' align='center' cellpadding='1' cellspacing='1' bgcolor='F3F9FC'><tr>"
+"<td bgcolor='9FCAF2' align='center'>姓 名</td>"
+"<td><input type='text' id='cName'></td></tr>" +"<tr><td><input type='button' value='确定' onclick='parent.window.callTest();'></td></tr></table>";

}
//var element = document.getElementById("fzr");
oPopup.show(10,25,300,250);

}
setFzr();
/* ]]> */
</script>
</div>
</form>
</BODY>
</HTML>

------解决方案--------------------
oPopup = window.createPopup(); 
所以,oPopup的父窗口是页面
如果要引用输入的内容,你该用 oPopup.document.getElementById('cName').value
------解决方案--------------------
有人问过啦,请看:http://topic.csdn.net/t/20040731/20/3230423.html