jsp中的js代码放在head中不显示
<script type="text/javascript">
function nextPage(pageNum) {
document.getElementById("cpn").value = pageNum;
document.getElementById("type").value = "";
document.getElementById("ediForm").submit();
}
function previousPage(pageNum) {
document.getElementById("cpn").value = pageNum;
document.getElementById("type").value = "";
document.getElementById("ediForm").submit();
}
function firstPage() {
document.getElementById("cpn").value = "1";
document.getElementById("type").value = "";
document.getElementById("ediForm").submit();
}
function endPage(pageNum) {
document.getElementById("cpn").value = pageNum;
document.getElementById("type").value = "";
document.getElementById("ediForm").submit();
}
function go()
{
if(validateNum($("#cpn").val()))
{
alert("页码格式不正确");
document.getElementById("cpn").value = "${page.currentPageNum}";
return;
}
var sumNum = ${page.pageNum};
var cNum = document.getElementById("cpn").value;
if(cNum>sumNum){
alert("跳转页数不能大于总页数");
return;
}
document.getElementById("ediForm").submit();
}
var index ={ind:""};
var selected={data:""};
function selectedPayMethod(obj){
index.ind=obj.selectedIndex;
ediForm.pay_type.value=obj.options[obj.selectedIndex].value;
var selectedDate=ediForm.pay_type.value;
// alert(selectedDate);
selected.data=selectedDate;
}
function checkForm() {
confirm("您已经进入函数,继续执行?");
showValue();
var cpn = document.getElementById("cpn");
if(cpn != null){
cpn.value = "1";
}
var vip_accn=document.getElementById("vip_accn").value;
var user_account=document.getElementById("user_account").value;
var pay_type =document.getElementById("pay_type").value;
var pay_b=document.getElementById("pay_b").value;
var pay_e=document.getElementById("pay_e").value;
var dept_code=document.getElementByiD("dept_code").value;
alert(dept_code);
if(dept_code==""||dept_code==null){
alert("请选择部门单位!");
return false;
}
if(pay_b==""||pay_b==null||pay_b==""||pay_b==null){
alert("支付日期不能为空,请输入支付日期!");
return false;
}
document.getElementById("ediForm").action="/ECManager/servlet/EmployDevMemberPoints?dept_code="+dept_code+"&pay_type="+index.ind;
document.getElementById("ediForm").submit();
}
</script>
为什么这段代码放在jsp页面的body里面能执行,但是放在head中不能执行
[解决办法]