2012-09-12 3 views
3
의 통합에 대한 IE에서 일부 오류

모두, 내가 직면 한 문제 :ZK 및 자바 스크립트

ZUL 코드

다음 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> 

기능이 일부에서 하나 개의 새로운 창을 여는 브라우저가 있으며 크롬, Firfox에서 잘 작동합니다. 하지만 IE8에서 실행하면 몇 가지 오류가 발생합니다.

클라이언트 오류 : 스크립트를 처리하지 못했습니다. 오류 80020101로 인해 작업을 완료 할 수 없습니다. (오류)

이 문제는 해결책이 있습니까? 대단히 감사합니다 !!!

답변

1

Executions.getCurrent().sendRedirect(string, string)javadocs을 서버 측에서 사용할 수 있습니다. 그러나 이러한 간단한 요구 사항 때문에 서버에 갈 필요가 없습니다. ZK의 client namespace을 사용하면 클라이언트 쪽에서 button 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>  
+1

답장을 보내 주셔서 감사합니다. IE8에서 메서드를 사용해 보았습니다. 'Execution.getCurrent ...'는 정상적으로 작동하지만 윈도우가 터지는 크기를 제어 할 수 없습니다. 두 번째 방법 인 'w : onClick = "testAlert();"'가 발생합니다. 원인 : org.xml.sax.SAXParseException : 요소 유형 "button"과 연관된 속성 "w : onClick"의 접두어 "w"가 바인드되지 않았습니다. – Gallery

+1

나는 다시 시도했다, 너는 맞다 !!! 마지막으로 xmlns : w = "client"를 잊어 버렸습니다. 고마워요! – Gallery