関数を呼び出そうとしていますが、値を適切にエスケープして適切に渡すのに苦労しています。私は現在持っています:
function selectdone(sel, title_id, status_type) {
...
}
$(function() {
$("td.status-updates").click(function() {
if ($(this).find('#sel').length == 0) {
var before = $(this).text();
var title_id = $(this).parent().attr('id');
var status_type = $(this).attr('class');
$(this).html("<select id='sel'
onchange='selectdone(this," + title_id + "," + status_type +");'...
<option>NS</option></select>");
}
});
私がこれから得続けるエラーはですUncaught SyntaxError: Unexpected identifier
。
ただし、正常に'selectdone(this," + title_id + ");...
機能するようにパスすると、3つパスしようとすると、そのエラーが発生します。
注:status_type
変数(複数のクラス)にはスペースがあります。