-
Notifications
You must be signed in to change notification settings - Fork 508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not override/bind AJAX #181
Comments
Firstly, jquery-ujs no longer supports jquery 1.4.2, it's now jquery 1.6 and later. So there are going to be things that don't work when using 1.4.2. However, this is unrelated to the particular behavior you're seeing. What's happening is that 2 requests are being made, because first, jquery-ujs is making a remote call (since you put If you want jquery-ujs to handle the remote call and fire the callbacks, then get rid of your manual ajax call. Otherwise, get rid of the If you're still having problems, please post over on the jquery-ujs issues. |
Also, it might be helpful to read through some of the articles in the wiki. I also wrote a top-down guide to using jquery-ujs that might help. |
@JangoSteve: I am working on porting Spree project to the new jQuery 1.6. And peculiar I found that the same code only create 1 request under jQuery 1.4.2 + old UJS version. So I guess jQuery 1.4.2 + old UJS did the job wrongly. |
That could be the case. It's been a very long time since we jquery-ujs supported 1.4.2. |
Has this been figured out then? I'd like to close the issue if possible. |
yes please, it's resolved. On Tue, Jul 19, 2011 at 3:18 AM, JangoSteve <
|
With jQuery 1.4.2 and Rails 3.x (manual method), I could override and bind the ajax to invoke callbacks on ajax success. However, this doesn't work with jquery-ujs 1.0.12 and Rails 3.1 (git) that leads to two requests to be invoked instead of one. I suspect this is related to issue #10 Here is an example:
Generate test app
Make sure we're usin the latest 3-1-stable by modify
Gemfile
:Modify following files:
app/controllers/states_controller.rb
:app/views/states/index.html.erb
:app/assets/javascripts/states.js
:With the help of Firebug, it is indicated that there are 2 requests invoked. This might explain that the binding is not successful.
The text was updated successfully, but these errors were encountered: