zoukankan      html  css  js  c++  java
  • JSON 操作

    function loadPage() {
        $.ajax({
            url: '/upos_service/getproductInfobyid',
            type: 'GET',
            data: { 'productId': $.getUrlVar("productId") },
            success: function (responseText) {
                var result = eval("(" + responseText + ")");
                if (result != null) {
                    $("#lblProductName_0").html(result.product.Name);
                    $("#lblProductMemo_0").html(result.product.Description);
    
                    for (var i = 0; i < result.subProductList.length; i++) {
    
                        $("<input>", { "type": "radio", "name": "subProduct", "value": result.subProductList[i].Id }).appendTo($("#listDiv"));
                        var desc = $("<b>", { "class": "redFont" });
                        $("<span>", { "id": "lblSubProdPrice_" + i }).html(result.subProductList[i].Price.toFixed(2)).appendTo(desc);
                        $("<span>").html("元/"+(i+1)+"年  ").appendTo(desc);
                        desc.appendTo($("#listDiv"));
                    }
                    if (result.subProductList.length > 0) {
                        $(":radio[name='subProduct']")[0].checked = true;
                    }
                    var userType = User.GetUserType();
                  
                    if (userType < 1) {
                        $("#txtUserMobile").show();
                    }
                    else {
                         $("label[for='txtUserMobile']").hide(); //bug when txtUserMobile invisible              
                         $("#txtUserMobile").hide();
                    }
                }
            }
        });
    }
    

      

  • 相关阅读:
    如何实现序列化为json
    unity中camera摄像头控制详解
    eclipse配置c开发环境
    uml和模式01
    angular2开发01
    微信公众平台开发01
    最新无线网卡驱动安装
    交换ctrl和caps_loack的新方法
    web.xml文件详解
    设计模式中的里氏代换原则
  • 原文地址:https://www.cnblogs.com/stanley107/p/2934562.html
Copyright © 2011-2022 走看看