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();
                    }
                }
            }
        });
    }
    

      

  • 相关阅读:
    HTML介绍
    python D41 前端初识
    mysql索引原理与查询优化
    python D41
    python D40 pymsql和navicat
    python D40 以及多表查询
    python D35 selectors模块
    python D35 I/O阻塞模型
    测试过程
    测试基础
  • 原文地址:https://www.cnblogs.com/stanley107/p/2934562.html
Copyright © 2011-2022 走看看