2013-07-05 30 views
0

我使用一個帶有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> 
+0

能否請您提供您的HTML語法錯誤? –

+0

好的,我已經完成了 – cnxk

回答

0

更改此功能

function cancelEdit(){ 
     $('#id').remove(); 
    } 
+0

沒有語法錯誤,因爲如果我使用not uploadify,沒有問題,但是謝謝 – cnxk

+0

如果您認爲線路有錯誤,請在您的答案中提供正確的代碼。 –