技术实践
ES6模板字符串拼接HTML
ES6模板字符串拼接HTML

模板字符串拼接
js
let html = `【<input onblur="handleBlurInput(this,${JSON.stringify(item).replace(/\"/g, '\'')})" validate="${JSON.stringify(item)}" contenteditable="true" value="${item.value}" placeholder="${item.placeholder}">】`;
普通拼接
js
html = '<input onblur="handleBlurInput(' + JSON.stringify(item).replace(/\"/g, '\'') + ')"/>'
js
'<a id="adw" href="javascript:void(0)" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow"
onclick="InLocation(' + row.x + ',' + row.y + ',' + row.ID + ',\'' + temp + '\');">
定位</a>
 | 
<a id="a" href="javascript:void(0)" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" onclick="myAjax(' + row.ID + ');">
删除</a>