Rails 3.0 :remote => true with ie9 will double submit form when I click on submit button
I have a Rails 3.0 app which is using a normal :remote => true option for a form_for. It works correctly in all browsers except IE9. Even IE8 works ok. But in IE9, I can see by using the F1开发者_如何学运维2 developer tool that it is issuing 2 requests to the server when I click the submit button.
Here's the form_for:
<%= form_for @project, :project, :url => create_project_url, :remote => true do |f| %>
Here's the submit button:
<%= submit_tag 'Create' %>
Looking at the F12 information it shows 1 request initiated by "JS Library XMLHttpRequest" and one initiated by "click".
Does anyone have an idea how to prevent this?
I found the solution to my problem. Upgrading my prototype.js and rails.js files to the latest did the trick. Upgrading the prototype.js file was the most important, but I did the rails.js one just to make sure.
Here's a link to the latest prototype.js download: http://www.prototypejs.org/download
精彩评论