开发者

Form:has selector does not work on IE

I am trying to use "form:has" selector which works on Chrome but no开发者_如何学Got on IE.

http://jsbin.com/uvumu/2

Does anyone have any idea why it is not working on IE? (when pushing the Post button there should be an alert box)

Edited:

Here is the code:

JS:

  $(document).ready(function() {

    $(".comment-link").live('click',function() {
      return false;
    });

    $("#morefeeds-link").click(function () {
      return false;
    });
    // Form submittion - doesnt work
    $("form:has(.commentBtn)").live('submit',function () {
       alert("a");
      return false;
    });

    return false;
  });​

HTML

<form>

  <a href="#" class="comment-link" style="font-size:12px;">Comment</a>

    <table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td valign="middle">
          <input type="hidden" name="commentkey" value="1">
          <input type="text" name="commenttext" class="commentfocus" value="Express your opinion">
        </td>
        <td valign="middle"><input type="submit" class="commentBtn" value="Post"></td>
      </tr>
    </table>

 </form>


Live submit is broken in IE if you register a live click event earlier. See http://dev.jquery.com/ticket/6359 for a bug report and a hack to circumvent the issue.

There's also a discussion about it in the jquery forums: http://forum.jquery.com/topic/ie-specific-issues-with-live-submit

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜