前台通过ajax从后台获取判断的数据,前台根据传回来的值重定向到登录页面 
求大牛
 $.ajax({
          async:false,
          cache:false,
          data:param,
          type:"post",
          url:"${ctx}/sysUserOnline/personEcc",
          success:function(data){
            var type1=data.message;
            if("1"==type1){
              //屏蔽掉
              document.getElementById("submitOk").style.display = "none";
              document.getElementById("annTable").style.display = "none";
               //这里就要跳到登录页了
              ////alert("当前已登录了一个用户,同一窗口中不能登录多个用户!");
              return;
            }else if("2"==type1){
              alert("5672");
              document.getElementById("submitOk").style.display = "none";
              document.getElementById("annTable").style.display = "none";
              //response.sendRedirect("http://localhost:8080/xinma");
              //<jsp:forward page="/login.jsp" />
              //alert("该账号已登录,是否登录系统?");
              return;
            }

解决方案 »

  1.   

    加上window.navigate(url);可以重定向了
      

  2.   

    window.location.href='http://localhost:8080/xinma';
    既然是跳转页面,为啥还用ajax呢?
    既然用了jquery,为啥还用document.getElementById呢?
      

  3.   

    那怎么从后台去获取判断的数据?Document是把table不显示 隐藏掉 
      

  4.   

    你的做法是对的 只需要把location.href='登录页url';加到你的 //这里就要跳到登录页了  这儿就行了还有2楼同学的意思是说 既然你用jquery 就可以用$('#submitOk')去代替 document.getElementById("submitOk")