首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

50分求救,Struts中如何让页面跳出一个对话框

2011-12-05 
50分求救,Struts中怎么让页面跳出一个对话框谢谢各位大哥赐教!!![解决办法]out.println( script alert

50分求救,Struts中怎么让页面跳出一个对话框
谢谢各位大哥赐教!!!

[解决办法]



out.println( " <script> alert( '这样就弹出来了啊 '); </script> ");
[解决办法]
同意楼上。
或者用 BODY 的 onload 触发中。
[解决办法]
function openWin(url, target, width, height, top, left) {
if (orteusSubmitStatus) {
return null;
}
if (url.indexOf( "? ") != -1) {
url += "&windowType= " + POPUP_WINDOW;
} else {
url += "?windowType= " + POPUP_WINDOW;
}
url += "&com.nec.jp.orteusActionMethod.orteusSubmitByLink=controlStart ";

var win = window.open (url, target,
"width= " + width +
", height= " + height +
", top= " + top +
", left= " + left +
", toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no ");
win.focus();
if (window.gSubWindow == null) {
window.gSubWindow = new Array();
window.gSubWindow[0] = win;
} else {
var subWindowCnt = window.gSubWindow.length;
var isSetted = false;
for (var i = 0; i < subWindowCnt; i++) {
try {
if (window.gSubWindow[i] == null || window.gSubWindow[i].closed) {
window.gSubWindow[i] = win;
isSetted = true;
break;
}
} catch (e) {
window.gSubWindow[i] = win;
isSetted = true;
break;
}
}
if (!isSetted) {
window.gSubWindow[subWindowCnt] = win;
}
}
return win;
}
[解决办法]
在action中 request.setAttribute( "showMsg ", "××成功! ");
在jsp页尾处加入JS
<script language= "javascript ">
var showMsg= " <%=request.getAttribute( "showMsg ")%> ";
if(showMsg!= "null "&&showMsg!= " "){
alert(showMsg);
}
</script>
这样弹出信息就会出现。不知你问的是不是这个意思!
[解决办法]
<logic:equal name= "flag " value= "1 ">
<script language= "javascript ">
alert(‘ <bean:write name= "s "/> ');
</script>
</logic:equal>
需要显示的时候在action中把flag设置成1,alert内容可以写成静态,也可以在action中设置s来实现
[解决办法]
var now=new Date();
var number=now.getSeconds();
var minute=now.getMinutes();
var sum= number*minute;
var objReturn=showModalDialog( "reserve.do?action=detailed&j_code= "+j_code+ "&id= "+id+ "&sum= "+sum, "dialogWidth: "+600+ "px; dialogHeight: "+600+ "px; ");

热点排行
Bad Request.