$("#btn_query").click(function () {
var input = {
Customer: $("#ddlCustomer").val(),
CustPoName: $("#ddlCustPoName").val(),
CustPoNo: $.trim($("#txt_search_PoNo").val()), // 去除空格
CustPoVer: $("#ddlCustPoVer").val()
};
// 給jQuery對象動態添加屬性
if ($("#Alpha_1").length > 0) {
input['Alpha_1'] = $.trim($("#Alpha_1").val());
}
// 用jQuery將JavaScript對象轉換為QueryString查詢字符串的方法
var send = $.param(input);
//console.log(send);
swal(send, { icon: "info" });
// Customer=HANGSHUN&CustPoName=AI_PO&CustPoNo=&CustPoVer=1&Alpha_1=LDH
// 下拉框都必須選擇,否則,彈窗提示 if (!input.Customer || !input.CustPoName || !input.CustPoVer) { var info = "所有下拉列表都是必選項,請選擇!"; swal(info, { icon: "warning" }); return; } // Do something. });




// 用jQuery將JavaScript對象轉換為QueryString查詢字符串的方法 var send = window.location.href +"?"+ $.param(input); //var send = document.URL +"?"+ $.param(input);
swal(send, { icon: "info" }); // http://localhost:54225/CustomerPo/CustomerPoList?Customer=HANGSHUN&CustPoName=AI_PO&CustPoNo=&CustPoVer=1&Alpha_1=LDH

