Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does .live() binding work for jQuery in IE7?

I have a piece of javascript which is supposed to latch onto a form which gets introduced via XHR. It looks something like:

$(document).ready(function() {

   $('#myform').live('submit', function() {
      $(foo).appendTo('#myform');
      $(this).ajaxSubmit(function() {
        alert("HelloWorld");
    });
       return false;
   });

});

This happens to work in FF3, but not in IE7. Any idea what the problem is?


2 Answers

The submit event is not currently supported by Events/live.

Possible event values: click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, keydown, keypress, keyup

Currently not supported: blur, focus, mouseenter, mouseleave, change, submit

like image 155
Christian C. Salvadó Avatar answered Mar 23 '26 22:03

Christian C. Salvadó


How are you excuting the submit? Can you try this instead?

$(':submit').live('click', function(e) {
  $(foo).appendTo('#myform');

  $('#myform').ajaxSubmit(function() {
    alert('Hello World');
  });

  e.preventDefault();
  return false;
});
like image 22
bendewey Avatar answered Mar 23 '26 22:03

bendewey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!