监听手机键盘输入操作

//监听手机输入键盘操作
	document.onkeyup = function(event) {
		var keyCode = event.keyCode||event.which;
		if(keyCode==13){
			var search=$.trim($("#search").val()),type=$("#search").attr("data-type"),url="";
			if(type=="all"){
				url="***********";
			}else{
				url="***********";
			}
			window.location.href=url+"?search="+search;
		}
	}

你可能感兴趣的:(javascript)