帮助了 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   云的旋律  阅读(2508)  评论(0编辑  收藏  举报

编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 25岁的心里话
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!
· 零经验选手,Compose 一天开发一款小游戏!

导航

统计

前端攻城狮分享群
点击右上角即可分享
微信分享提示