zoukankan      html  css  js  c++  java
  • jq简单的Ajax数据操作. 函数

    function AiaxProduct() {
    //产品名称
    var productName = $("#ICNO").val();
    $.ajax({
    url: "@Url.Action("AjaxGetLXChannelProducts", "Order")",   //提交的控制器方法.
    type: "GET",   //请求方式

    cache: false,   //是否缓存

    contentType: "application/json; charset=utf-8",
    data: {         //数据参数
    Page: 1,
    MerchantCode: MerchantCode,
    ChannelCode: '@ViewBag.ChannelCode',
    ProductName: productName
    },
    beforeSend: function () {
    //$('#dk_refresh').show();
    },
    success: function (data) {  //数据成功后的绑定   data 执行成功返回的数据
    var objs = data;
    if (objs == null || objs.Data.length == 0) {
    $("#table_bug_reportpro").html("<div colspan="88">暂无数据</div>");
    }
    else {
    var data = objs.Data;
    var Html = "<ul>";
    for (var i = 0; i < objs.Data.length; i++) {
    Html += '<li><span class="img_xuanzhong"></span> <span style="position: absolute; left: 40px;">';
    Html += '' + data[i].ProductName + '</span> <span class="pick"><ul style="list-style-type:none">';
    Html += '<li style="background-color:#ddd" onclick="UlLi(this);"><span>-</span></li>';
    Html += '<li style="border-left: 0px;"><span class="guid">0</span></li>';
    Html += '<li style="border-left: 0px;" onclick="UlLi(this);"><span>+</span></li>';
    Html += '<li name="Money" style="visibility:hidden">' + data[i].ProductPrice + '</li>';
    Html += '<li name="product" style="visibility:hidden">' + data[i].ProductId + '</li>';
    //1::旅游集团 2:区域代理 3:独立企业,4:OTA,5: 旅行社,6:个人代理,7: 其他组织 , 10: 中间商 ,11: 代理商 ,',
    Html += '<li name="enterpriseType" style="visibility:hidden">' + data[i].EnterpriseType + '</li>';
    Html += '</ul></span></li>';
    }
    Html += "</ul>";
    $("#table_bug_reportpro").html(Html);

    }
    }
    })
    }

  • 相关阅读:
    学习:Radio Button和Check Box
    学习:访问Edit Control的七种方法
    实现:EDIT控件字符个数与长度的计算
    学习:GDI基础
    学习:MFC的CWinApp和CFrameWnd
    学习:远程代码注入
    实现:获取指定进程PID
    学习:远程线程实现DLL注入和shellcode注入以及OD调试原理
    学习:内存映射文件
    实现 Trie (前缀树)
  • 原文地址:https://www.cnblogs.com/TanYong/p/6687637.html
Copyright © 2011-2022 走看看