最近在写一个jsp时出现了一个状况;在input的button按钮点击一直没有反应,页面按f12后就可以点击,
后来在网上查询说是有可能页面没有渲染成功。
当时按照网上的说法进行了调整也没有成功。后来无意间看到我写的这个方法名有些过于“正规”(autoActive()),
怀疑是不是这个方法名与js文件封装的名称有冲突呢。于是改了一个名称之后果然成功了,将方法autoActive()改为了autoActivePF()
以下是页面内容:
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/tag/eoms-taglib" prefix="eoms"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="/tag/ext" prefix="ext"%>
<html>
<head>
<script type="text/javascript" language="javascript">
function autoActivePF(){
Ext.Msg.wait("提示!","派发旨令中,请耐心等待...");
Ext.Ajax.request({
//url:'${pageContext.request.contextPath}/jkMonitorAction!doV4Monitor.ilf',
url:'${pageContext.request.contextPath}/netServicehaltAction!autoActive.ilf',
//params:{flow_id:'${object.flowId}',workitemId:'${object.workitemId}'},
params:{flow_id:'11111222',workitemId:'33333'},
timeout:120000,
success:function(response){
var responseData = Ext.util.JSON.decode(response.responseText);
Ext.Msg.hide();
if(responseData.success!=null){
//document.getElementById("opticalCheckHtml").innerHTML=responseData.msg;
//document.getElementById("opticalCheckDetail").value=responseData.msg;
}
if(responseData.no!=null){
//document.getElementById("no").value=responseData.no;
alert(responseData.no);
}else{
//document.getElementById("no").value="false";
alert('false');
}
},
failure:function(response){
Ext.Msg.hide();
Ext.Msg.alert('错误','连接超时!');
}
});
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<jsp:include flush="true" page="/jsp/wfdesign/wf/basic/autoload/common_deal_btns.jsp"></jsp:include>
<table class="table-a">
<jsp:include flush="true" page="/jsp/wfdesign/wf/basic/autoload/task_operate_info.jsp"></jsp:include>
<jsp:include page="/jsp/app/inc/taskFlag.jsp"/>
<tr>
<td colSpan="1" rowSpan="1" class="td-b">
是否驳回
</td>
<td colSpan="3">
<input type="radio" name="FORMDESIGN_isreject" value="true"/>是
<input type="radio" name="FORMDESIGN_isreject" value="false" checked="checked"/>否
<input type="button" id="autoActive" name="autoActive" value="是否需要自动派发停机指令" onclick="autoActivePF()"/>
<span id="openresult" name="openresult" >返回结果:</span>
<span id="openresultV" name="openresultV" ></span>
</td>
</tr>
</table>
</body>
</html>