2012-04-26 08:42:28 +00:00
|
|
|
$(document).on('click', '#ajax_form_submit', function(){
|
2011-12-28 12:49:53 +00:00
|
|
|
$('#ajaxForm').ajaxSubmit({
|
|
|
|
beforeSubmit: function(a,f,o) {
|
|
|
|
o.dataType = 'script';
|
2012-08-06 09:34:00 +00:00
|
|
|
if (o.dataType == 'script') {
|
|
|
|
o.url = o.url.split('?'); // split on GET params
|
|
|
|
if (o.url[0].substr(-3) != '.js') o.url[0] += '.js'; // force rails to respond to respond to the request with :format = js
|
|
|
|
o.url = o.url.join('?'); // join on GET params
|
|
|
|
alert(o.url)
|
|
|
|
}
|
2011-12-28 12:49:53 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|