求教:浏览器与对话框间的自定义对象传递 尝试将你的对象放到HTC中封装.方法就可以用了.你传递时只传递数组. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是啊 搞lotus快三年啦HTC中封装 我还没用过 先研究先,不知还有什么好方法可以实现呢 还有人有好的介绍没,能给我几个好的例子,或者电子书等等都行(HTC的)小弟我没找到啊 以下为test.html的源代码<html><head><script>function test(){ oMainObj=new Object(); //oObj.cus为自定义属性 oMainObj.cus='aaaaaaaaaaaaaaaa'; alert( oMainObj.cus ); sReturn=window.showModalDialog("test1.html", oMainObj ) if ( sReturn=='ok' ) { alert( oMainObj.cus ); } else { alert( 'fail!fail!' ); }}</script></head><body><input type='button' value='test' onclick='test()'></body></html>以下为test1.html的源代码,test.html和test1.html必须放在同一目录下<html><head><script>function change(){ //oObj其实就是主页面中的oMainObj,js中对象的传递都是引用传递 oObj=window.dialogArguments; oObj.cus='change!change!change!'; window.returnValue='ok'; window.close();}</script></head><body><input type='button' value='change' onclick='change()'></body></html>你可以在出现对话框后点击按钮看看效果。或直接关闭不点击按钮看看是不是和点击后有所不同! struts2+javascript 刷新页面后,输入框中的内容没有被清除 求解代码运行的思路·· JavaScript对javaweb开发重要吗 求JS大虾,两个下拉列表的值比较。 大虾请进来帮忙解决个JS问题,谢谢! 在js代码 里增加 div 的问题 怎么判断一个字符串里分割符间是否有数据? FileUpload 上传组件问题 在线请教高手------如何将复选框的结果变灰,让用户不能更改? 为啥length不属于节点的属性呢 javascript和asp是什么关系,谁大谁小?? 请问,怎么让文本框失效并显示灰色???
HTC中封装 我还没用过 先研究先,不知还有什么好方法可以实现呢
小弟我没找到啊
<head>
<script>
function test()
{
oMainObj=new Object();
//oObj.cus为自定义属性
oMainObj.cus='aaaaaaaaaaaaaaaa';
alert( oMainObj.cus );
sReturn=window.showModalDialog("test1.html", oMainObj )
if ( sReturn=='ok' )
{
alert( oMainObj.cus );
}
else
{
alert( 'fail!fail!' );
}
}
</script>
</head>
<body>
<input type='button' value='test' onclick='test()'>
</body>
</html>以下为test1.html的源代码,test.html和test1.html必须放在同一目录下<html>
<head>
<script>
function change()
{
//oObj其实就是主页面中的oMainObj,js中对象的传递都是引用传递
oObj=window.dialogArguments;
oObj.cus='change!change!change!';
window.returnValue='ok';
window.close();
}
</script>
</head>
<body>
<input type='button' value='change' onclick='change()'>
</body>
</html>你可以在出现对话框后点击按钮看看效果。或直接关闭不点击按钮看看是不是和点击后有所不同!