$dd = "<a href='javascript:void(0);' id='requestsend$send_id' onClick='request($send_id,request_send);' class='post-add-icon inline-items'><button type='button' style='background: #ccc;' class='btn btn-add-frnd' data-toggle='tooltip' title='request' data-original-title='Mark as read'>send</button></a>";
我变得这样:
未捕获的ReferenceError:请求未定义 在HTMLAnchorElement.onclick
我期望这样:
<a href='javascript:void(0);' id='requestsend$send_id' onClick='request("5","request_send");' class='post-add-icon inline-items'><button type='button' style='background: #ccc;' class='btn btn-add-frnd' data-toggle='tooltip' title='request' data-original-title='Mark as read'>send</button></a>
但是得到了:
<a href='javascript:void(0);' id='requestsend$send_id' onClick='request(5,request_send);' class='post-add-icon inline-items'><button type='button' style='background: #ccc;' class='btn btn-add-frnd' data-toggle='tooltip' title='request' data-original-title='Mark as read'>send</button></a>
答案 0 :(得分:0)
请尝试以下代码:
<a href='javascript:void(0);' id='requestsend$send_id' onClick='request(' $send_id ', ' request_send ');' class='post-add-icon inline-items'><button type='button' style='background: #ccc;' class='btn btn-add-frnd' data-toggle='tooltip' title='request' data-original-title='Mark as read'>send</button></a>