document.getElementById('search_field').onkeypress = function(e) {
if (!e) e = window.event;
var keyCode = e.keyCode || e.which;
if (keyCode == '13') {
window.location.href = '/search/?s=' + $('#search_field').val();
return false;
}
};
最后一个括号告诉我一个错误,并非所有代码路径都返回一个值,这里似乎有什么问题?谢谢