jejacks0n/mercury — pull request #49 by JeanMertz (2011-10-21 14:41:08+00:00)
Title: Allow custom dataType on page save

This allows you to set the dataType that is expected to be returned by the server when saving a page.

This can be helpful when you want the server to return some custom javascript action instead of a json value. If we do not set the dataType value to `script` instead of `json`, the jQuery.ajax event will fire `error` instead of `success`, resulting in a Mercury alert that the page couldn't be saved (which is false).

We could leave this value empty and let jQuery guess the kind of response (which it does quite well), but Rails actually uses the value to set the type of request being sent. Also,

You can read more about this at http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings