1.在js中加入一个方法:
function judge_enter(){
if(window.event.keyCode==13){
return false;//阻止页面刷新的作用
}
}
2.然后在body中
标签<input type=‘text‘ id=‘text‘ size=‘10‘ onkeypress=‘judge_enter();‘/>
text输入框中按下enter键时阻止刷新页面
原文:http://www.cnblogs.com/sky6699/p/4921029.html