我对JavaScript不太熟悉
为什么?
<input id="imageBN" type="image" name="imageField" src="../images/sousuo.gif" onclick="checkOn();" /><script type="text/JavaScript">
<!--
function checkOn() {
window.location.href='http://www.sina.cn';
}
//-->
</script>不跳转呢?
为什么?
<input id="imageBN" type="image" name="imageField" src="../images/sousuo.gif" onclick="checkOn();" /><script type="text/JavaScript">
<!--
function checkOn() {
window.location.href='http://www.sina.cn';
}
//-->
</script>不跳转呢?
.net 会自动生成<form name="aspnetForm" method="post" action="index.aspx" id="aspnetForm">
<input>是按钮. 就会先走action="index.aspx" 所以我跳不过去. 可以把<inpu>的按钮功能去了吗? 或着用图片? 图片有onclick="checkOn();" 功能吗?
e = e || window.event;
window.location.href = 'http://www.sina.cn';
if (e.stopPropagation) e.stopPropagation();
else e.cancelBubble = true;
if (e.preventDefault) e.preventDefault();
else e.returnValue = false;
}直接用img替代更好
function checkName(){
var title=document.getElementById("title").value;
CompetitionManageService.check(title,checkNameUnique);
}
function checkNameUnique(data){
var createtime = document.getElementById("createTime").value;
var overtime = document.getElementById("overTime").value;
var tit='${actionResult.guess.title}';
var title=document.getElementById("title").value;
if(!data && tit!=title){
alert("标题已经被使用,请换个标题");
return false;
}
else{
if("${actionResult.update}" == 1)
document.forms[0].action = "<%=webRoot%>/competition/competition_updateCompetition.action?overTime="+overtime+"&createTime="+createtime;
else
document.forms[0].action = "<%=webRoot%>/competition/competition_addCompetition.action?overTime="+overtime+"&createTime="+createtime;
document.forms[0].submit();
}
}
function addG(){
window.location.href="<%=webRoot%>/groups/groups_showadd.action";
}