0

我使用了一个带有uploadify控件的div,然后使用jsrender绑定数据进行编辑,但是当我想删除div以取消IE中的编辑时,错误提示“需要对象”,然后失败。谁知道为什么,请告诉我,谢谢!主要代码:

    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:&lt;/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:&lt;/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>
4

1 回答 1

0

更改此函数中的语法错误

function cancelEdit(){
      $('#id').remove();
    }
于 2013-07-05T08:32:10.023 回答