Javascript JQuery:事件未绑定到动态创建的表;甚至使用$(document).on

Javascript JQuery:事件未绑定到动态创建的表;甚至使用$(document).on,javascript,jquery,Javascript,Jquery,在某些情况下,表是在JSP中动态生成的;但是没有执行以下Jquery: $(document).on("click", "a.fileDownload", function () { $.fileDownload($(this).prop('href')) .done(function () { }) .fail(function () { }); return false; //Critical to stop the click event which

在某些情况下,表是在JSP中动态生成的;但是没有执行以下Jquery:

$(document).on("click", "a.fileDownload", function () {

   $.fileDownload($(this).prop('href'))
    .done(function () {  })
    .fail(function () {  });

    return false; //Critical to stop the click event which will trigger a normal file download
});

FileDownload Plugin: https://github.com/johnculviner/jquery.fileDownload
为了进行调试,我打开firebug并检查代码,发现如下内容:

<a class="fileDownload" href="http://test.myportalen.de/bin/my/Filereader.svc/GetDocument/id/1232312/name/qwerty.pdf">qwerty.pdf</a>

(在firebug中,当我在锚文本中添加空格并还原为原始文本时,事件被触发。有人能解释原因和解决方案吗?无法创建fiddle)

更新:JSP供参考

<c:when test="${document.extension eq 'pdf'}">
  <a href="${document.link}" class="fileDownload">
    <c:choose>
       <c:when test="${document.docType}">
          ${fn:trim(document.docTitle)}
       </c:when>  
       <c:otherwise>
          ${fn:trim(document.docTitle)}.${fn:trim(document.extension)}
       </c:otherwise>
      </c:choose>
    </a>


真的有人在使用Firebug了吗?哇!谢谢它在编码、实时结果和调试方面仍然对我有很大帮助:)。对查询有什么想法吗?有可能分享一个小提琴演示吗?你真的应该用Chrome做测试。更好的开发工具。FF也因不遵循标准而闻名。如果它在小提琴中不可复制,那么代码中的其他内容会影响它