`

window.opener.document.Form.*与window.opener.document.getElementById('formName')

 
阅读更多

近日在生产服务器端发现一个问题,本应该正常显示的页面报出js错误。

“Automation 服务器不能创建对象”

而该页面在前日都正常运行,且代码没有任何改动。

诊查下来,发现唯一的区别是在子页面上

 

window.opener.document.Form.*

中的FORM表单的名字明显很长,而之前正常运行的form表单名比较短。

经过测试将form表单的名字修改到很短的时候,代码可以正常运行。而因为表单名称是动态变化的,明显不能通过修改表单名称长度来解决问题。

后来将上面的Js修改为window.opener.document.getElementById('formName').*

后,页面正常运行

 

根据该现象总结:前一方式对于Form表单名称长度应该有限制,而后者没有,具体底层原因未知,望高手解答,谢谢!

分享到:
评论

相关推荐

    javascript window.opener的用法分析

    比如点击了a.htm上的一个链接而打开了b.htm,然后我们打算在b.htm上输入一个值然后赋予a.htm上的一个id为“name”的textbox中,就可以写为: window.opener.document.getElementById(“name”).value = “输入的数据...

    字符串 window.open() window.opener window.name window对象等的总结

    2个页面,加了注释,很清晰。

    通过window.opener控制父窗体

    可以看一看啊 博文链接:https://bageer707.iteye.com/blog/74458

    解决window.opener=null;window.close(),只支持IE6不支持IE7,IE8的问题

    window.opener=null;window.close(),只支持IE6不支持IE7的问题 打开新窗口并且关闭本窗口不弹出要关闭窗口前的提示function openWin(){window.open(‘login.jsp’,”,’fullscreen=yes,menubar=no,resizable=no’);...

    window.opener用法和用途实例介绍

    window.opener,是通过window.open打开子窗体的父窗体的引用。 比如在父窗体parentForm里面,通过window.open(“subForm.html”),那么在subform.html中window.opener就代表parentForm。既然在子窗体中能够拿到父窗体...

    showModalDialog open弹出子窗口操作parent、opener父窗口及跨域处理

    3> IE与FireFox对两个弹出窗口在跨域时的解析也有不同:通过window.dialogArguments操作父窗口时,在IE下不需要指定document.domain而在FireFox下则正好相反需要指定才能生效;采用opener方式操作父窗口时都不需要...

    Javascript中封装window.open解决不兼容问题

    对window.open进行封装, 使其更好用, 且更兼容, 很多人说window.open不兼容,其实不是, 因为不能直接执行, 必须通过用户手动触发才行;看代码: 代码如下 var openWindow = function(url, options) { var str = ""; ...

    jsp 刷新父页面

    window.parent.dialogArguments.document.execCommand('Refresh'); 或 Response.Write("<script>window.location.href = window.location.href</script>"); 刷新本页Response.Write("<script>window.location....

    解析jquery获取父窗口的元素

    (“#父窗口元素ID”,window.parent.document); 对应javascript版本为window.parent.document.getElementByIdx_x(“父窗口元素ID”);取父窗口的元素方法:$(selector, ...$(selector, window.opener.document);$(s

    JS window.opener返回父页面的应用

    JS代码: window.open(); 而当支付成功后,需要关闭支付平台支付成功界面,并在客户端加载客户端支付成功页面,JS代码: window.opener.location.href=url;window.close();

    用window.open,opener实现网页间通信

    如果网页 A 可以发送信息到网页 B,反之也然,而不必动用请求/应答模式,该是一件多么惬意的事儿。可以轻松地实现聊天不是吗?

    关闭时刷新父窗口两种方法

    window.opener.location.reload()刷新父窗口window.opener.location.reload() 与 window.opener.location.href=window.opener.location.href 都是弹出窗口关闭时用来刷新父窗口。 但[removed].Reload 如果有数据提交...

    javascript的document.referrer浏览器支持、失效情况总结

    虽然Traffic source有很多种,不过不幸的是依据现在JS,获得Traffic source的途径只有两种——document.referrer、window.opener.更不幸的是,window.opener适用的场景不多,而document.referrer非常的弱,以至于很...

    window.close(); 关闭浏览器窗口js代码的总结介绍

    window.opener=null; window.open(”,’_self’); window.close();   firefox IE7,Opera, chrome,safari Close 3 window.open(”,’_self’); window.close();   firefox IE7,Opera, chrome,sa

    [removed].reload 刷新使用分析(去对话框)

    使用[removed].reload;...window.opener.location.href=window.opener.location.href; window.opener.location.reload(); 这种写法就不出现那讨厌的对话框啦! 介绍JS实现刷新iframe的方法 <iframe src=”1.ht

Global site tag (gtag.js) - Google Analytics