【问题标题】:how to remove uploadify control in div correctly with jquery如何使用jquery正确删除div中的uploadify控件
【发布时间】:2013-07-05 08:07:52
【问题描述】:

我使用了一个带有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:</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?

标签: javascript jquery flash uploadify jsrender


【解决方案1】:

更改此函数中的语法错误

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

【讨论】:

  • 没有语法错误,因为如果我使用不上传,没有问题,但是谢谢
  • 如果您认为该行有错误,请在您的答案中提供正确的代码。
猜你喜欢
  • 1970-01-01
  • 2011-01-03
  • 1970-01-01
  • 1970-01-01
  • 2011-06-03
  • 1970-01-01
  • 2010-10-31
  • 1970-01-01
相关资源
最近更新 更多