- $('form', hash.w).each(function() {this.action += '?ajax=1';});
+ $('form', hash.w).each(function() {
+ if (this.action.search('[\\?&]ajax=1') != -1)
+ return;
+ if (this.action.search('\\?') != -1)
+ this.action += '&ajax=1';
+ else this.action += '?ajax=1';
+ });
$('form', hash.w).ajaxForm({
dataType: 'json',
target: $('.target', $window),
success: function(response) {
if (response.success) {
$('.target', $window).text(response.message);
$('form', hash.w).ajaxForm({
dataType: 'json',
target: $('.target', $window),
success: function(response) {
if (response.success) {
$('.target', $window).text(response.message);