避免重复加载 (CI)
/*全民看盘*/
$('#qmkp').click(function () {
//alert("9999");
//alert("herer");
if($("#qmkps tr").length>0){
}else{
var Ajaxurl = "<?php echo site_url('bactive/qmkp'); ?>";
$.ajax({
type: 'post',
url: Ajaxurl,
data: '',
success: function (mag) {
//alert(mag);
$("#qmkps").html(mag);
}
});
}
})
//TP
$('#add_lable').click(function(){
var new_lable = $('#new_lable_id').val();
if(new_lable == ''){
alert("标签名不能为空!");
}else{
/*添加新标签*/
var f_id = $('#f_id').val();
var Ajaxurl = "/admin.php/Lable/pass_add";
$.ajax({
type: 'post',
url: Ajaxurl,
data: 'lable_name='+new_lable+"&f_id="+f_id,
success: function (mag) {
if(mag == 0){
alert("添加标签失败");
}else{
//console.log(mag)
var option_html='';
for(var i=mag.length-1;i<mag.length;i++){
//console.log(mag[i].lable_name)
var option = "";
option += "<option value=" + mag[i].lable_id +"</option>" + mag[i].lable_name +"</option>";
option_html += option;
}
$('#staus1').append(option_html);
$('#new_lable_id').val('');
alert("添加标签成功");
}
}
});
}
})