function fakeProgress(v, el) {
 
    if (v > 100)      var bool = window.confirm("是否同意公司的保密协议?");
if (bool){
var url = '${pageContext.request.contextPath}/userRights.do?menu=jurisdiction&userCode=' + userCode;
doSubmit(url);
}
    else     {      setSB(v, el);      window.setTimeout("fakeProgress(" + (++v) + ", document.all['" + el.id + "'])", 20);    }javascript函数中能跳转到SSH中action中吗?(我的是错误的,请高手指点,依然在线等)

解决方案 »

  1.   

    直接用window.location.href=actionUrl不就行嚒
      

  2.   

    document.forms("").action='XXXXAction.action';这样就OK 了
      

  3.   

    还是无法到达我要去的action,在页面的左下脚出现了网页有错误。
    感谢上面各位大佬的回帖。
     function fakeProgress(v, el) {
     
        if (v > 100){
    window.location.href='/userRights.do?menu=jurisdiction&userCode'+userCode; }
        else     {      setSB(v, el);      window.setTimeout("fakeProgress(" + (++v) + ", document.all['" + el.id + "'])", 20);    }
      

  4.   

    window.location.href='/userRights.do?menu=jurisdiction&userCode'+userCode;
    这种方式需要http打头
    jsp把下面几个值打印出来看看,你就知道怎么办了
    String url = request.getRequestURL().toString();
    String path = url.substring(0, url.lastIndexOf("/"));
    String url1 = request.getContextPath();
    String root = url.substring(0, url.indexOf(url1));
      

  5.   


    js里有错误呗,用firebug调试下看看那里错了,另外url最好加上basepath,而不要用相对路径。
      

  6.   

    <%@page language="java" pageEncoding="UTF-8"%>
    <%@page import="java.util.List"%>
    <%@page import="com.baidu.manageSystem.machineRoom.dto.Users"%><%
    Users userCode=(Users)request.getAttribute("userCode");

     %>
    <html><head><title>正在载入...</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
    <script language="javascript">  function setSB(v, el) {    var ie5 = (document.all && document.getElementsByTagName);    if (ie5 || document.readyState == "complete")     {      filterEl = el.children[0];      valueEl = el.children[1];      filterEl.style.width = v + "%";      valueEl.innerText = v + "%";    }  }  function fakeProgress(v, el) {
     
        if (v > 100){
    window.location.href='/userRights.do?menu=jurisdiction&userCode=?'+userCode;

    }
        else     {      setSB(v, el);      window.setTimeout("fakeProgress(" + (++v) + ", document.all['" + el.id + "'])", 20);    }  } </script> 
    <body  onload="fakeProgress(0, sb)" topmargin=180 bgcolor=#eeeeee >
    <center> 
    <form action="">
    <font color=gray> <p align=center style="color: #0085dd; font-family: ??ì?; font-szie:12px; line-height: 100%">读取数据中,请耐心等待</p></font><span id=sb style="width: 300px"><div style="filter: Alpha(Opacity=0, FinishOpacity=60, style=1, StartX=0, StartY=0, FinishX=100, FinishY=0); width: 0%; height: 12px; position: absolute; background: #9999ff"></div><div style="font-size: 12px; width: 100%; color: #ff3333; font-family: arial; text-align: center"></DIV>
    </p></td></form></tr></table></body></html>
    这是我那页面代码  不知道哪错了,高手们麻烦给看下
      

  7.   

    这是放在netbeans中调试出来的结果 Shutting down v3 due to startup exception : Address already in use: bind: 8080