我已經在我的JavaScript文件下面的代碼:如何解決JavaScript SyntaxError:無效或意外的令牌錯誤?
input = '<input id="ytRequirementsForm_additional_f__12" type="hidden" value="" name="RequirementsForm[additional][f__12][]" />
<input class="form-control" name="RequirementsForm[additional][f__12][]" id="RequirementsForm_additional_f__12" type="file" />
<div class="RequirementsForm_additional_f__12 fileprogress" style="display: none"><div class="filename">
<span class="glyphicon glyphicon-paperclip" aria-hidden="true"></span>
<strong></strong>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="progress">
<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="1"
aria-valuemin="0" aria-valuemax="100">
<span class="percent">0</span>%
</div>
</div>
<div class="info_danger_text"><p></p></div>
</div>
';
但是,當我跑我的web應用程序,它顯示未捕獲SyntaxError: Invalid or unexpected token
錯誤。我該如何解決它?
貌似缺少'「'在失去了一些東西,也許'字符串 – Eruant
年底」'在結束了嗎? – guradio
你不能這樣做JS中的多行字符串。要麼使用模板字符串要麼跳過換行符。 – Sirko