我使用一個帶有uploadify控件的div,然後使用jsrender綁定數據進行編輯,但是當我想移除div來取消IE中的編輯時,錯誤顯示「object需要「,然後失敗。誰知道爲什麼,請告訴我,謝謝! 主要代碼:如何使用jquery正確地移除div中的uploadify控件
function edit(){
$("#id").html($("#editTmpl").render(data));
uploadify init
}
function cancelEdit(){
$("#id).remove();
}
html代碼:
<div id="editTmpl" type="text/x-jsrender">
<div class="editRow rowEdit communityDraw">
<dl>
<dt>drawing:</dt>
<dd class="divDrawingsContainer" data-id="{{>CommunityId}}">
<div class="attachmentToolbar"><span>
<input id="file_upload-{{>CommunityId}}" type="file" /></span></div>
<div id="uploadingFiles-{{>CommunityId}}"></div>
<div id="divDrawingsDisplayBody-{{>CommunityId}}"></div>
</dd>
</dl>
<i class="clearfloat"></i>
</div><div class="editRow rowEdit communityDraw">
<dl>
<dt>drawing:</dt>
<dd class="divDrawingsContainer" data-id="{{>CommunityId}}">
<div class="attachmentToolbar"><span>
<input id="file_upload-{{>CommunityId}}" type="file" /></span></div>
<div id="uploadingFiles-{{>CommunityId}}"></div>
<div id="divDrawingsDisplayBody-{{>CommunityId}}"></div>
</dd>
</dl>
<i class="clearfloat"></i>
</div>
<div>
能否請您提供您的HTML語法錯誤? –
好的,我已經完成了 – cnxk