極快瑞的函數式編程,Jquery涉及的一些函數

來源:互聯網
上載者:User

標籤:函數   ready   pid   add   https   function   var   處理   mil   

$(function(){
  一些實現功能的代碼;
})
————————————
文檔載入完成後執行的函數。
$(function(){}) 是 $(document).ready(function(){}) 的簡寫,用來在DOM載入完成之後執行一系列預先定義好的函數。就是你接下來要做的那個東西,<body onload=fun()>
等頁面出來之後直接自動地執行這個函數
****************************************************
最先加個按鈕 並作為標記 id = “add_role”
然後使用者點擊這個按鈕之後,就觸發了事件
$("#add_role").click(function(){
  var row = delRow("noRole_list");
  assign("add",row,"1");
})

*********************************************
然後就是這個底層函數的具體實現了
function assign(way,row,userId){
  for(var i =0;i<row.length;i++){
    $.ajax({
     url : lst_url + "/organ/addOrDelRole.go",
      data:{
      groupId:userId,
        ids:row[i].userId,
        way:way,
      },
      dataType:"json",
      success:function(){
      console.log("成功啦");
      }
      error:function(){
      console.log("失敗啦");
      }
    }
  });
 }
}
——————————————————————————————————————————————————
最後的最後
通過這個url請求,

Request URL:

https://gsp0.baidu.com/8qUZeT8a2gU2pMbgoY3K/su?wd=3&prod=zhidao&_=1495192667074
通過後面這3個索引值對的形式,傳遞到背景程式
後台通過
HttpServletRequest類的方法,擷取參數方法
 String wd = request.getParamter("wd")
對這些資料進行處理,用到List ArrayList JSONArray JSONObject
等這些儲存方式



極快瑞的函數式編程,Jquery涉及的一些函數

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.