帮助了 AmazingCounters.com 位小伙伴

js 拼接参数

htmlString += "<td><button type=\"button\" onclick=\"artdel('"+productionObj.id+"')\" class=\"btn btn-primary\">删除</button>" +
    "&nbsp;&nbsp;" +
    "<a href='#'><button type=\"button\" class=\"btn btn-warning\" onclick=\"loadMsg('"+productionObj.id+"')\">修改</button></a>" +
    "&nbsp;&nbsp;" +
    "<a href='#'><button type=\"button\" class=\"btn btn-warning\" onclick=\"sendMsg('"+productionObj.id+"','"+productionObj.get('title')+"','"+productionObj.get('contnt')+"')\">推送</button></a>" 
    
    htmlString += "</tr>";
onclick=\"sendMsg('"+productionObj.id+"','"+productionObj.get('title')+"','"+productionObj.get('contnt')+"')\"

 

//保存取值
function saveData() {
    //$("#divShow").show();
    var obj = {};
    obj.openId = myOpenId;
    obj.nickname = myNickname;// 微信昵称
    obj.headimgurl = myHeadimgurl;// 用户头像
    // obj.activityimg = "xx";//活动图片
    if (ImgPath == "" || ImgPath == null) {
        WX.alertMsg("照片不能为空~");
        return;
    }
    obj.activityimg = ImgPath;
    if ($("#content").val() == "" || $("#content").val() == null) {
        WX.alertMsg("祝福语不能为空~");
        return;
    }
    obj.content = $("#content").val();
}

//加载赋值
$.ajax({
                    url : './XXXXXX/' + data.openId,
                    type : 'get',
                    success : function(data) {
                                            $("#area").val(data.area);
                            $("#address").val(data.address);
                            $("#telphone").val(data.telphone);
                    },
                    error : function() {
                        WX.alertMsg("请稍候再试~");
                    }
                });                        

 

 

 

onclick="goShowNotice(\'"+obj.id+"\')"


/**
 * 跳转文本
 */
 function goShowNotice(id) {
        window.location.href = "/showNotice.html?id=" + id;
    }

 

html += "<a href=\"javascript:void(0)\"  onclick=\"getAttrName('" + obj.id + "','" + obj.attributeName + "','" + strlist[k] + "');\">" + strlist[k] + "</a>";
_html += "<td><button id=\"btn_"+obj.id+"\" class=\"btn btn-primary\" title=\"确认收款\" onclick='Policy.getCharge("+obj.id+")'><i class=\"fa  fa-money\"></i></button>&nbsp;";

 

posted on 2015-05-07 14:02  云的旋律  阅读(2503)  评论(0编辑  收藏  举报

导航

前端攻城狮分享群