AJAX和jquery简单试用

 var urlso=window.location.href;
 urlso=urlso.substring(urlso.indexOf("/mip/")+5);
 $.ajax({
  type:"post",
  url:"../publicWebc/queryPermission.so",
  async:false,
  data:{urlso:urlso},
        dataType:"json",
  success:function(data){
   var unAbleBtn = data.data;
   if(unAbleBtn=="N"){
    $("body").html("您没有权限访问此页面!");
   }else{
    if(unAbleBtn.length>0){
     $("[id^='permission_']").each(function(){
      var id = $(this).attr("id");
      var bthName = id.substring(id.indexOf("_")+1);
      if(unAbleBtn.indexOf(bthName)!=-1){
       $(this).hide();
      }
     });
    }
    
   }
   
  }
 });

posted on 2018-11-21 13:42  低调后的华丽  阅读(148)  评论(0编辑  收藏  举报

导航