2024年9月dialogarguments(求js弹出窗口修改数据然后返回的方法)

 更新时间:2024-10-12

  ⑴dialogarguments(求js弹出窗口修改数据然后返回的方法

  ⑵求js弹出窗口修改数据然后返回的方法

  ⑶常用两种返回方法:.window.showModalDialog(url,args,dialogattrs)?参数说明:?url:弹出页面地址?agrs:主窗口传给对话框的参数,可以是任意类型(数组也可以?dialogattrs:弹出窗口的样式参数?模式对话框用法:?主窗口:var?value?=window.showModalDialog(’test.jsp’,strs,’resizable:yes’);?弹出框中通过window.returnValue设置返回值。。window.open:?【父窗口】?代码如下:?《script》?function?show_child()?{?var?child=window?.open(“child.html“,“child“,“height=,width=,status=yes,toolbar=no,menubar=no,location=no“);?/*?if(!child.closed)?{?if(!window?.close())?{?var?textValue?=?frm.txt.value;?parent.frm.txt.value?=?textValue;?}?else?{?window?.close();?child.close();?}?}*/?}?《/script》?《a?href=“javascript:show_child();“》打开子窗口《/a》?《form?name=frm》?《input?type=“text“?name=“txt“?id=“txt“》?//注意这里一定要写ID属性不然FF下取不到值?《/form》?【子窗口】代码如下:?《script》?function?choseItem()?{?var?v=““;?var?check_item?=?document.frm.item;?for(i=;i《check_item.length;i++)?{?if(check_item.checked)?{?v+=“,“+check_item.value;?}?document.frm.txt.value=v.replace(/^,{}/,““);?}?}?function?foo()?{?window?.close();?window?.opener.document.getElementById(“txt“).value=document.getElementById(“txt“).value?}?《/script》?《body》?《form?name=frm》?《input?type=checkbox?name=item?value=?onclick=“choseItem();“》a?《input?type=checkbox?name=item?value=?onclick=“choseItem();“》b?《input?type=checkbox?name=item?value=?onclick=“choseItem();“》c?《input?type=checkbox?name=item?value=?onclick=“choseItem();“》d?《input?type=text?name=“txt“?id=“txt“》?《/form》?《input?type=button?value=“关闭“?onclick=“foo();“》?《/body》

  ⑷模态对话框如何调用父窗口的JS函数

  ⑸在父窗口里showModalDialog里面加个参数window.showModalDialog(“XXXXX.html“,window,“页面的大小等属性“);在模式窗口里window.dialogArguments.jshanshu()如果不行就再看看是不是父窗体里面的js写错了

  ⑹“window.parent”和“window.dialogArguments”的区别是什么

  ⑺“window.parent”和“window.dialogArguments”的区别主要体现在适用范围以及调用方法。

  ⑻window.parent:frame框架里的页面要改其他同框架下的页面或父框架的页面就用parent。

  ⑼window.dialogArguments:dialogArguments属性只适用于创建使用showModalDialog和showModelessDialog方法的窗口。dialogArguments只能在mode和modeless窗口中才能使用,可以传递传递任意类型的值。

  ⑽window.dialogArguments调用方法如下:

  ⑾父类窗口代码(弹出模式对话框:

  ⑿window.showModalDialog(url,window);?例如:

  ⒀//子窗体关闭的时候刷新父窗体

  ⒁window.dialogArguments.location.href=window.dialogArguments.location.href;

  ⒂window.focus();

  ⒃window.close();

  ⒄//子窗口调用父窗口里的函数:

  ⒅window.dialogArguments.函数名();

  ⒆简单回答:自己看,不再赘述用iframe、弹出子页面刷新父页面iframeparent.location.reload();弹出子页面window.opener.location.reload();子窗口刷新父窗口self.window.opener.locaction.reload();刷新一open(方法打开的窗口window.opener.location.href=window.opener.location.href刷新以winodw.showModelDialog()方法打开的窗口window.parent.dialogArguments.document.exeommand(’Refresh’);或Response.Write(“《script》window.location.href=window.location.href《/script》“);刷新本页Response.Write(“《script》window.location.href=window.location.href;《/script》“);刷新父页和本页面:Response.Write(“《script》alert(’提交成功!’);window.location.href=window.location.href;window.opener.location=window.opener.location;《/script》“);

  ⒇jsp父页面如何获取弹出的对话框中的值

  ⒈《!DOCTYPEHTMLPUBLIC“-//WC//DTDHTML.Transitional//EN“》《HTML》《HEAD》《TITLE》NewDocument《/TITLE》《METAcontent=“EditPlus“name=“Generator“》《METAcontent=““name=“Author“》《METAcontent=““name=“Keywords“》《METAcontent=““name=“Description“》《scriptlanguage=“javascript“》《!--functionopenChild(){varaa=document.getElementById(“txt“).value;vark=window.showModalDialog(“child.html“,aa,“dialogWidth:px;status:no;dialogHeight:px“);if(k!=null)document.getElementById(“txt“).value=k;}//--》《/script》《/HEAD》《BODY》《FONTface=“宋体“》《/FONT》《br》传递到父窗口的值:《inputid=“txt“type=“text“value=““name=“txt“》《br》返回的值:《inputid=“txt“type=“text“name=“txt“》《br》子窗口设置的值:《inputid=“txt“type=“text“name=“txt“》《br》《inputid=“Button“onclick=“openChild()“type=“button“value=“openChild“name=“Button“》《/BODY》《/HTML》child.html《!DOCTYPEHTMLPUBLIC“-//WC//DTDHTML.Transitional//EN“》《HTML》《HEAD》《TITLE》NewDocument《/TITLE》《METAcontent=“EditPlus“name=“Generator“》《METAcontent=““name=“Author“》《METAcontent=““name=“Keywords“》《METAcontent=““name=“Description“》《metahttp-equiv=“Expires“content=““》《metahttp-equiv=“Cache-Control“content=“no-cache“》《metahttp-equiv=“Pragma“content=“no-cache“》《/HEAD》《BODY》《FONTface=“宋体“》《/FONT》《br》父窗口传递来的值:《inputid=“txt“type=“text“name=“txt“》《br》输入要设置父窗口的值:《inputid=“txt“type=“text“name=“txt“》《inputid=“Button“onclick=“setFather()“type=“button“value=“设置父窗口的值“name=“Button“》《br》输入返回的值:《inputid=“txt“type=“text“name=“txt“》《inputid=“Button“onclick=“retrunValue()“type=“button“value=“关闭切返回值“name=“Button“》《inputid=“Button“onclick=““type=“button“value=“关闭刷新父窗口“name=“Button“》《scriptlanguage=“javascript“》《!--vark=window.dialogArguments;//获得父窗口传递来的值if(k!=null){document.getElementById(“txt“).value=k.document.getElementById(“txt“).value;}//设置父窗口的值functionsetFather(){k.document.getElementById(“txt“).value=document.getElementById(“txt“).value}//设置返回到父窗口的值functionretrunValue(){vars=document.getElementById(“txt“).value;alert(s);window.returnValue=s;window.close();}//--》《/script》《/BODY》《/HTML》

  ⒉访问网页出现“错误:’window.dialogArguments.’为空或不是对象”,怎么办

  ⒊你所使用的浏览器不能完全支持页面里的脚本,而且出现频率并不低。遇到“脚本错误”时一般会弹出一个非常难看的脚本运行错误警告窗口,而事实上,脚本错误并不会影响网站浏览,因此这一警告可谓多此一举。要关闭警告则可以在浏览器的工具菜单选择Inter选项,然后单击高级属性页。进入到浏览标签,并选中“禁止脚本调试”复选框,以后你就不会再收到这些警告了。

  ⒋firefox下如何关闭子窗口刷新父窗口-技术问答

  ⒌没人帮忙啊,不过没关系,问题解决了FF下错误是因为window.dialogArguments.document.URL=window.dialogArguments.location.href这句话的缘故,估计FF不支持document的URL属性,所以就错了,我改成下面的就正确了。呵呵window.dialogArguments.document.href=window.dialogArguments.location.href

  ⒍window.parent和window.dialogArguments的区别

  ⒎window.parent:frame框架里的页面要改其他同框架下的页面或父框架的页面就用parentwindow.dialogArguments:dialogArguments属性只适用于创建使用showModalDialog和showModelessDialog方法的窗口。dialogArguments只能在mode和modeless窗口中才能使用,可以传递传递任意类型的值;参考资料:

  ⒏后台弹出js警告框如何自动关闭

  ⒐后台JS警告框一般是使用HTML代码模拟或者Alert函数实现的。

  ⒑A页面通过window.dialogArguments.open弹出的子B页面怎么调用A页面的JS方法这可以解决吗

  ⒒将A页面的js代码全部使用加在外部js文件的方法,然后B页面也加在这个js文件就行了

您可能感兴趣的文章:

相关文章