嗨我有一个问题,代码在IE8和IE9上不起作用,但使用更高版本和其他浏览器,如chrome。该页面不会仅在IE8和IE9上重新加载。
场景我在单选按钮上选择1选项时正在做的事情。小组应该重新加载。
这是我的java代码。
ProfileBasePage.java
// Javascript used to resize the Modal page after hiding/showing components.
Public static String POPUP_RELOAD_JS =
"var iFrame = window.parent.document.getElementsByTagName('iframe')[0];"
+ "(iframe.onload)();";
/** Calls the Javascript code to reload the modal panel only when the popup parameter is set to true.*/
protected void reloadPopupiFrame(AjaxRequestTarget target)
{
//POPUP_PARAMETER="popup"
String popup = getRequest().getRequestParameters().getParameterValue(ProfileBasePage.POPUP_PARAM_KEY).toString();
//TRUESTRING = "true"
//append the javascript used to reload the modal iFrame.
if(ProfileBasePage.TRUESTRING.equalsIgnoreCase(popup))
{
target.appendJavaScript(POPUP_RELOAD_JS);
}
}
答案 0 :(得分:1)
如果你正在使用Wicket ModalWindow
类,你可以使用Wicket自己的JavaScript命令调整它的大小:
target.appendJavaScript("window.parent.Wicket.Window.current.autoSizeWindow();");
答案 1 :(得分:0)
(iframe.onload)()
看起来很可疑。也许旧的IE版本不支持它。
更好地使用正确的函数调用。即您的iframe应如下所示:<iframe onload="myOnLoadOrResizeHandler()"...>
然后由Wicket执行的JS代码应为:target.appendJavaScript("myOnLoadOrResizeHandler();")
。