我正在尝试在我的 JSF 网页上添加 html5 拖放上传文件,因此我必须将此脚本添加到其中
<script type="text/html" id="template-uploads">
//<![CDATA[
<div data-bind="visible: showTotalProgress()">
<div>
<span data-bind="text: uploadSpeedFormatted()"></span>
<span data-bind="text: timeRemainingFormatted()" style="float: right;"></span>
</div>
<div class="uploadimage-totalprogress">
<div class="uploadimage-totalprogressbar" style="width: 0%;" data-bind="style: { width: totalProgress() + '%' }"></div>
</div>
</div>
<div data-bind="foreach: uploads">
<div class="uploadimage-upload" data-bind="css: { 'uploadimage-uploadcompleted': uploadCompleted() }">
<div class="uploadimage-fileinfo">
<strong data-bind="text: fileName"></strong>
<span data-bind="text: fileSizeFormated"></span>
<span class="uploadimage-progresspct" data-bind="visible: uploadProgress() < 100"><span data-bind="text: uploadSpeedFormatted()"></span></span>
</div>
<div class="uploadimage-progress">
<div class="uploadimage-progressbar" style="width: 0%;" data-bind="style: { width: uploadProgress() + '%' }"></div>
</div>
</div>
</div>
//]]>
</script>
如果我取出脚本周围的 cdata 标签,我会收到此错误:
与元素类型“span”关联的属性“data-bind”的值不能包含“<”字符。