-
Notifications
You must be signed in to change notification settings - Fork 505
Closed
Labels
Description
On IE8 at least, the following does not work. (Using rails.js of November 07, 2011, and jQuery 1.6.2)
- Load the HTML below into IE8
- Open the developer tools (F12) and switch to the log console on the scripts subtab
- Press the Submit button
Here's the console output that is generated. Note the submit event is received twice: first with event == null and second with a valid event object.
LOG: submit form; event = null
ERR: 'null' is null or not an object
LOG: submit form, event = [object Object]
Removing the rails.js include or the data-remote attribute on the form makes it all work again. As expected the handler is only called once, and the event object actually exists.
<!DOCTYPE html>
<html>
<head>
<title>Rails.js Bug Demo</title>
</head>
<body>
<form action="/submit/path" data-remote="true">
<input type="submit">
</form>
<script src="./jquery.min.js"></script>
<script src="./rails.js"></script>
<script>
$('form').submit(function (event) {
console.log('submit form, event = ' + event);
event.preventDefault(); // Will cause error because event == null.
return false; // To prevent moving away from this page.
});
</script>
</body>
</html>Reactions are currently unavailable