Add note to readme that having javascript tags outside the head can lead to multiple ajax submits #185

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

Added a quick note to the readme about a (admittedly silly) problem I had. Javascript tags (javascript_include_tag etc.) outside the head can lead to events being bound multiple times and causing multiple ajax submits etc.

@segfault88 segfault88 Added note that javascript outside the head tag can lead to events be…
…ing bound multiple times and causing multiple ajax submits etc.
b994598
Collaborator

reed commented Feb 19, 2013

I think most of what you're trying to say can be inferred from other parts of the readme. That said, I think it might be helpful if we just added a line to the "Evaluating script tags" section saying something like:

As a rule of thumb when switching to Turbolinks, move all of your javascript tags inside the head and then work backwards, only moving javascript code back to the body if absolutely necessary.

What do you think?

reed closed this in 0a72fd6 Mar 5, 2013

Sorry, yes - you are right. I was trying to put in keywords (hoping to have the solution come up in Google), but what you wrote is probably better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment