zoukankan      html  css  js  c++  java
  • jquery的post异步请求

    1.jQuery.post( url, [data], [callback], [type] ) :使用POST方式来进行异步请求

    参数:

    url (String) : 发送请求的URL地址.

    data (Map) : (可选) 要发送给服务器的数据,以 Key/value 的键值对形式表示。

    callback (Function) : (可选) 载入成功时回调函数(只有当Response的返回状态是success才是调用该方法)。

    type (String) : (可选)官方的说明是:Type of data to be sent。其实应该为客户端请求的类型(JSON,XML,等等)

    $.post("/backend/loadUserTypeList.html",{"s_roleId":rolt},function(result){
                if(result!=null){
                    for(var i=0;i<result.length;i++){
                        $("#selectusertype").append("<option value=""+result[i].valueId+"" >"+result[i].valueName+"</option>");
                    }
                }else{
                    alert("用户类型加载失败")!
                }
                
            },'JSON');

  • 相关阅读:
    别让猴子翻到背上
    python生成二维码
    50条经典爱情观
    智力测试题
    SQL数据库优化
    递归函数实现二分查找法
    软件开发类别
    递归函数的深度问题
    UVALive
    UVALive
  • 原文地址:https://www.cnblogs.com/sllcom/p/7859323.html
Copyright © 2011-2022 走看看