<script>
function f1()
{ var myObject = new Object();
myObject.firstName ="ssssssss";
myObject.lastName ="dddddddddd";window.showModalDialog ('a.html', myObject, 'height=100, width=400, top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no') ;
}
</script>
<input type="button" onclick=f1() value="ssssssssss">
////////a.html
<script>
function f1()
{
var oMyObject = window.dialogArguments;
var sFirstName = oMyObject.firstName;
var sLastName = oMyObject.lastName;
document.all.txt1.value=sFirstName;
document.all.txt2.value=sLastName;}
</script>
<input type="button" onclick=f1() value="oooo">
<br>
<input type="text" id="txt1">
<input type="text" id="txt2">
function f1()
{ var myObject = new Object();
myObject.firstName ="ssssssss";
myObject.lastName ="dddddddddd";window.showModalDialog ('a.html', myObject, 'height=100, width=400, top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no') ;
}
</script>
<input type="button" onclick=f1() value="ssssssssss">
////////a.html
<script>
function f1()
{
var oMyObject = window.dialogArguments;
var sFirstName = oMyObject.firstName;
var sLastName = oMyObject.lastName;
document.all.txt1.value=sFirstName;
document.all.txt2.value=sLastName;}
</script>
<input type="button" onclick=f1() value="oooo">
<br>
<input type="text" id="txt1">
<input type="text" id="txt2">
a.htm中有个控件按钮,点击后出现b.htm,
b.htm中的数值要回调到a.htm中可能要设计到后台
现在想只用js,或者ajax能实现吗还是谢谢clare2003
<form name="form1">
<input type="text" value="1" name="T1">
<input type="button" onclick="window.open('b.htm');" value="open b.htm">
</form>b.htm
<script>
alert(opener.form1.T1.value);
opener.form1.T1.value = "nnnnn"
</script>
这个方法是可以实现,但我要不是不用open()函数打开是否还可以用呀?
dialogArguments用于showModalDialog 和showModelessDialog