ajax里的el表达式要怎么写呀?

jsp里的代码:
<td><span class="td_special" title="查看产品详情"><a href="javascript:void(0)" onclick="getChildPage(this)">详情</a></span>
<span class="td_special" title="删除产品"><a href="${pageContext.request.contextPath}/order/deliveryss/${product.product_id}">删除</a></span></td>
<td hidden><span class="product_id">${product.product_id}</span></td>

ajax里写的是这样:

tbody.append("<tr><td><input type='checkbox' class='cbx_select' id='cbx_product_select_" + product_id + "'><label for='cbx_product_select_" + product_id + "'></label></td><td title='"+product_name+"'>" + product_name + "</td><td title='"+product_title+"'>" + product_title + "</td><td title='"+product_price+"'>" + product_price + "</td><td title='"+product_sale_price+"'>" + product_sale_price + "</td><td title='"+product_create_date+"'>" + product_create_date + "</td><td><span class='" + isEnabledClass + "' title='"+isEnabledTitle+"'>"+ isEnabled +
    "</span></td><td><span class='td_special' title='查看产品详情'><a href='javascript:void(0);' onclick='getChildPage(this)'>详情</a></span>"
    + " "+ "<span class='td_special' title='删除产品'><a href='${pageContext.request.contextPath}/order/deliveryss/${product.product_id}'>删除</a></span></td><td hidden><span class='product_id'>"
    + product_id + "</span></td></tr>");

 

jsp里的删除方法是好用的 一点击下一页触发ajax方法后 删除方法就不好用了 是哪里写错了吗

 

(`<tr><td><input type='checkbox' class='cbx_select' id='cbx_product_select_" + product_id + "'><label for='cbx_product_select_" + product_id + "'></label></td><td title='" + product_name + "'>" + product_name + "</td><td title='" + product_title + "'>" + product_title + "</td><td title='" + product_price + "'>" + product_price + "</td><td title='" + product_sale_price + "'>" + product_sale_price + "</td><td title='" + product_create_date + "'>" + product_create_date + "</td><td><span class='" + isEnabledClass + "' title='" + isEnabledTitle + "'>" + isEnabled +
            "</span></td><td><span class='td_special' title='查看产品详情'><a href='javascript:void(0);' onclick='getChildPage(this)'>详情</a></span>"
            + " " + "<span class='td_special' title='删除产品'><a href=${pageContext.request.contextPath}/order/deliveryss/${product.product_id}>删除</a></span></td><td hidden><span class='product_id'>"
            + product_id + "</span></td></tr>`)

${}是es6语法模板字符串,有了这个就不用字符串拼接了,直接用模板字符串

或者字符串拼接

 tbody.innerHTML=("<tr><td><input type='checkbox' class='cbx_select' id='cbx_product_select_" + product_id + "'><label for='cbx_product_select_" + product_id + "'></label></td><td title='" + product_name + "'>" + product_name + "</td><td title='" + product_title + "'>" + product_title + "</td><td title='" + product_price + "'>" + product_price + "</td><td title='" + product_sale_price + "'>" + product_sale_price + "</td><td title='" + product_create_date + "'>" + product_create_date + "</td><td><span class='" + isEnabledClass + "' title='" + isEnabledTitle + "'>" + isEnabled +
            "</span></td><td><span class='td_special' title='查看产品详情'><a href='javascript:void(0);' onclick='getChildPage(this)'>详情</a></span>"
            + " " + "<span class='td_special' title='删除产品'><a href="+pageContext.request.contextPath+'/order/deliveryss/'+product.product_id+">删除</a></span></td><td hidden><span class='product_id'>"
            + product_id + "</span></td></tr>");

 

您好,我是有问必答小助手,您的问题已经有小伙伴解答了,您看下是否解决,可以追评进行沟通哦~

如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~

ps:问答VIP仅需29元,即可享受5次/月 有问必答服务,了解详情>>>https://vip.csdn.net/askvip?utm_source=1146287632