rails/jquery-ujs — pull request #241 by ronalchn (2012-02-25 06:09:20+00:00)
Title: handleRemote - move crossDomain and dataType statements to read from dat...

...a attribute after 'ajax:before' event, to give it an opportunity to change these values dynamically

Tried to change the dataType in a ajax:before event, but discovered that the dataType variable was already set before ajax:before was called.

There may be cases when you want to change the dataType of the request dynamically - based on information only available when the event fires. This change allows the new value to be used immediately. The commit just moves code to after the event is fired.