<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>主页面</title> </head> <mce:script type="text/javascript"><!-- //传数组 function check(){ var mxh1 = new Array("mxh","net_lover","孟子E章") window.showModalDialog("test.html",mxh1,"unadorned:0;scroll:0;status:false;dialogWidth:380px;dialogHeight:200px"); } //传对象 function check1(){ var obj = new Object(); obj.name="zhangsan"; obj.age=2; obj.sex="男"; window.showModalDialog("aaa.html",obj,"unadorned:0;scroll:0;status:false;dialogWidth:380px;dialogHeight:200px"); } // --></mce:script> <body οnlοad="check1();"> </body> </html> test.html 源代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>获得主页面的值</title> </head> <body> <mce:script type="text/javascript"><!-- //传数组方式 //var test = dialogArguments; //alert(test[0]); //alert(test[1]); //alert(test[2]); //传对象方式 var obj = dialogArguments; alert(obj.name); alert(obj.age); alert(obj.sex); // --></mce:script> <input type="text" /> </body> </html>