读书人

用了ajax 以后页面还是跳 不成功提示

发布时间: 2013-10-25 14:36:53 作者: rapoo

用了ajax 之后页面还是跳 不成功提示框也不跳出来
页面 :<a href="" onclick="delete2(${s.partofWorkflow},${s.stepId})"> 删除</a>

js:

引用
function delete2(liucheng11,stepid){
alert(stepid);
var step11=stepid;
alert(liucheng11);
alert(step11);
$.ajax({
url:'delete223',
type : "post",
dataType : "json",
data : {"liucheng11":liucheng11,"step11":step11},
success : function(data) {

var liuchengid= liucheng11;
alert("stepid="+liucheng11);
alert("stepid="+stepid);
//var c="<%=basePath1%>";
var str=c+"delete2.action?id="+stepid+"&liuchengid="+liuchengid;
window.location.href=str;

},
error : function(XMLHttpRequest) {
alert($(".error", XMLHttpRequest.responseText).text());
}
});

}



Struts :
<action name="delete223" class="com.engineering.systemTM.action.UserAction" method="delete22">
<result name="success" type="json" />
<result name="error">/error.jsp</result>
</action>



public String delete22()throws Exception{ //日志删除
String liucheng11=getLiucheng11();
String step11=getStep11();
System.out.println("Step11+++++==="+step11);
int canp =server.findstep(liucheng11,step11);
//int tt=Integer.parseInt(session.get("userId").toString());
//System.out.println("id===="+userid);
//int canp= save1.quanxian(tt, GlobalVar.Logdelete);

System.out.println("日志删除="+canp);

if(canp!=0){
throw new Exception("此步骤是某步骤的上一步 ,不能删除");}else{
// System.out.println("日志删除456="+canp);
return SUCCESS;
}



}




怎么办 求帮助 java web
[解决办法]
<a href="javascript:;" onclick="delete2(${s.partofWorkflow},${s.stepId})"> 删除</a>

在看下 alert(stepid); 可以不 。

读书人网 >Java Web开发

热点推荐