Question

i use a div with uploadify control in it,then use jsrender bind data to edit,but when i want to remove the div to cancel edit in IE,a error says "object required",then failed.who knows why,please tell me,thanks! the main code:

    function edit(){
      $("#id").html($("#editTmpl").render(data));
      uploadify init
    }
    function cancelEdit(){
      $("#id).remove();
    }

the html code:

<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>
Was it helpful?

Solution

Change the syntax error in this function

function cancelEdit(){
      $('#id').remove();
    }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top