私のjQueryのコードは、次のエラーが供給されます。ここでは未知のSyntaxError:予期しないトークン。
Uncaught SyntaxError: Unexpected token ;
は私のjqueryのコードです:
<script type="text/javascript">
$(function() {
$('#CustomButton').click(function() {
$('#CustomPickedTable tbody').append(
$('<tr/>', {
click: function() {
$(this).remove()
},
html: $("<td />", {
html: $("#CustomQuestionText").val(),
'data-attr-id': 5
})
})
);
return false;
});
}); // <--- This line recieves the error
</script>
これは、このjqueryのコードのための私のマークアップです:
<table id="CustomPickedTable" class="box-style2">
<thead>
<tr>
<th>Valda frågor</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<br />
<p>Lägg till egen fråga</p>
<div class="editor-field">
@Html.TextAreaFor(model => model.CustomQuestionText, new { @class = "selectstyle", @id = "CustomQuestionText" })
@Html.ValidationMessageFor(model => model.CustomQuestionText)
</div>
<div>
<p><input type="button" id="CustomButton" value="Lägg till" /></p>
</div>
</div>
引き起こす可能性がどのようなこのエラーはどうすれば修正できますか? (注:事前
コードは正常です。このエラーは恐らく他の何かに関連しています。 –