IE中关于ZK和JavaScript集成的一些错误
Some error in IE about the integration of ZK and JavaScript
每个人,我遇到了一个问题:
ZUL代码:
<window title="Hello World!!" id="winMain" border="none" width="100%" height="100%">
<script type="text/javascript">
<![CDATA[
function testAlert() {
window.open ("http://cn.bing.com", "Show", "menubar=0,resizable=1,location=0,width=683,height=384");}
]]>
</script>
<div align="center">
<button id="btnShow" label="Show">
<attribute name="onClick">
<![CDATA[
Clients.evalJavaScript("testAlert()");
]]>
</attribute>
</button>
</div>
</window>
ZUL代码的功能是在一些浏览器中打开一个新窗口,它在CHROME、Firfox中运行良好。但当我在IE8中运行它时,会出现一些错误:
客户端错误:无法处理脚本;由于错误80020101,无法完成操作。(错误)
这个问题有什么解决办法吗?非常感谢!!!
您可以在服务器端使用Executions.getCurrent().sendRedirect(string, string)
javadocs来完成此操作。但对于这样一个简单的需求,您不需要转到服务器。使用ZK的客户端名称空间,您可以在客户端的按钮onClick事件上调用testAlert()函数。这两种方法都显示在下面的代码中,它在IE 8(标准模式)上工作
<window title="Hello World!!" id="winMain" border="none" width="100%" height="100%" xmlns:w="client">
<script type="text/javascript">
<![CDATA[
function testAlert() {
window.open ("http://cn.bing.com", "Show", "menubar=0,resizable=1,location=0,width=683,height=384");}
]]>
</script>
<div align="center">
<button id="btnShow" label="Show 1">
<attribute name="onClick">
<![CDATA[
Executions.getCurrent().sendRedirect("http://cn.bing.com", "_blank");
]]>
</attribute>
</button>
<button id="btnShow2" label="Show 2" w:onClick="testAlert();">
</button>
</div>
</window>
相关文章:
- Node.js v6.2.0类扩展不是函数错误
- Jquery菜单操作不稳定,定位不正确,存在一般错误
- document.open/document.write没有正确地清除chrome中的文档——这是chrome的错误吗
- 试图在引导模式内动态生成图表,得到offsetWidth错误
- 为什么会出现错误;未捕获的类型错误:undefined不是函数;
- 我如何修复包含在captcha的addthis中的错误
- 同样,同样的错误'ahorcado.js:26未捕获类型错误:无法读取属性'beginPath'
- 如何检测用于WebGL的专用或集成显卡
- 节点是否需要模块传递带有方括号的arg?这是个错误吗
- IE中关于ZK和JavaScript集成的一些错误
- 什么错误I'我在下面的jQuery代码中集成filepicker.io来上传一个图像文件
- Mixpanel javascript 集成:连续的事件在 mixpanel 结束时以错误的顺序记录
- Facebook与javascript FB Graph api的集成 墙上的帖子 Firefox 中的未知错误
- Braintree javascript 客户端 - 拆解调用不会删除现有的集成 - 在我的托管字段上获取错误
- 余烬集成测试错误.处理异步副作用
- javascript哈希映射中的QML集成错误
- 如何检查与nodejs的omegle集成中的错误(UNHANDLED EXCEPTION)
- 在游戏框架集成测试中禁用HtmlUnit javascript错误
- 如何将错误处理与控制器和服务集成
- 在rails应用中集成Stripe API时出现Javascript错误