?? common.js
字號:
var saleArrOne;
$(document).ready(function(){
$("#serialNo").blur(function(){
LoadProductInfo($(this).val());
});
$("#amount").keyup(function(){
if($(this).val()<1){
$("#amountError").html("數量不能小于1").css("color","red");
}else if($(this).val().length > 4){
$("#amountError").html("提示!購買數量超過4位數,請確保交易有效性").css("blue","red");
}else{
$("#amountError").html("");
}
});
$("#categoryId").change(function(){
var categoryId = $(this).val();
var arr;
$("#scale").val('');
for(var index=0;index<saleArrOne.length;index++){
arr=saleArrOne[index].split(':');
if(arr[0]==categoryId){
$("#scale").val(arr[1]);
}
}
});
});
//加載產品資料
function LoadProductInfo(productNo){
//判斷此頁面屬于那種mode
//加載接口
if($('#action').val()=='edit')return;
var ajaxUrl = "../AjaxProductInfoServlet";
$.ajax({
type: "GET",
url: ajaxUrl,
data: "productNo=" + productNo,
dataType: "json",
success: function(json){
if(json==null)
{
ShowProductInfo(productNo);
}else{
ShowProductError();
}
},
error: function(){ ShowProductError() },
beforeSend: function(){$("#productError").html('loading...');}
});
}
function ShowProductInfo(productNo){
$("#productError").html("商品編號可用").css("blue","red");
$("#submit").removeAttr("disabled");
}
function ShowProductError(){
$("#submit").attr("disabled","disabled");$("#productError").html("商品編號已被占用").css("color","red");
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -