jquery点击事件传值加载页面_jQuery添加options点击事件并传值
var formStr = "{'supplierId':'供應鏈企業|%-jm-sprt-%|93794498-3'}";
$.ajax({
type : "post",
dataType : "json",
cache : false,
url : "../../../webservice/gmall.json", // 提交到一般處理程序請求數據
data :"businessCode=61001001&message="+encodeURI(formStr).replace(/\+/g, "%2B"),
async : false,
error : function() {
//alert("connection error!!!");
layer.alert("數據加載失敗,請及時聯系管理員!",0);
},
success : function(data) {
var dataJson = strToJson(data.msg);
var shopname = dataJson.body.gmPage;
if(dataJson.head.status=='000000'){
$.each(shopname,function(i,item){
$("#store").append(""+item.name+"");
})
$("select").on('click',function (){
var opt = $(this).children('option:selected');
var shopId = $(opt).attr('id');
var shopType = $(opt).val();
var formStrshop = " {'shopId':"+shopId+",'shopType':"+shopType+"}";
if($("option").val()==''){
$("#tb").empty();
}
$.ajax({
type : "post",
dataType : "json",
cache : false,
url : "../../../webservice/gmall.json", // 提交到一般處理程序請求數據
data :"businessCode=61001003&message="+encodeURI(formStrshop).replace(/\+/g, "%2B"),
async : false,
error : function() {
layer.alert("數據加載失敗,請及時聯系管理員!",0);
},
success : function(data) {
var dataJson = strToJson(data.msg);
var shopname = dataJson.body.gmPage;
if(dataJson.head.status=='000000'){
$.each(shopname,function(i,item){
var attributeValue11 = dataJson.body.gmPage[i].attributeValue11;
$("#tb").empty();
$("#tb").append("
"+"
"+"
"+item.sn+""+"
"+item.name+""+"
"+item.attributeValue11+""+"
"+"
"+0+"");
})
}
}
});
})
}
}
});
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的jquery点击事件传值加载页面_jQuery添加options点击事件并传值的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Struts2_3_国际化处理_自定义拦
- 下一篇: gx works2 存储器空间或桌面堆栈