wp/wp-includes/js/wp-ajax-response.js
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
     9 		var r = {}, q, pp, i, p;
     9 		var r = {}, q, pp, i, p;
    10 		if ( !s ) { return r; }
    10 		if ( !s ) { return r; }
    11 		q = s.split('?'); if ( q[1] ) { s = q[1]; }
    11 		q = s.split('?'); if ( q[1] ) { s = q[1]; }
    12 		pp = s.split('&');
    12 		pp = s.split('&');
    13 		for ( i in pp ) {
    13 		for ( i in pp ) {
    14 			if ( jQuery.isFunction(pp.hasOwnProperty) && !pp.hasOwnProperty(i) ) { continue; }
    14 			if ( typeof pp.hasOwnProperty === 'function' && !pp.hasOwnProperty(i) ) { continue; }
    15 			p = pp[i].split('=');
    15 			p = pp[i].split('=');
    16 			r[p[0]] = p[1];
    16 			r[p[0]] = p[1];
    17 		}
    17 		}
    18 		return r;
    18 		return r;
    19 	},
    19 	},
    63 		return !wpAjax.invalidateForm( selector.find('.form-required').filter( function() { return jQuery('input:visible', this).val() === ''; } ) ).length;
    63 		return !wpAjax.invalidateForm( selector.find('.form-required').filter( function() { return jQuery('input:visible', this).val() === ''; } ) ).length;
    64 	}
    64 	}
    65 }, wpAjax || { noPerm: 'Sorry, you are not allowed to do that.', broken: 'Something went wrong.' } );
    65 }, wpAjax || { noPerm: 'Sorry, you are not allowed to do that.', broken: 'Something went wrong.' } );
    66 
    66 
    67 // Basic form validation.
    67 // Basic form validation.
    68 jQuery(document).ready( function($){
    68 jQuery( function($){
    69 	$('form.validate').submit( function() { return wpAjax.validateForm( $(this) ); } );
    69 	$('form.validate').on( 'submit', function() { return wpAjax.validateForm( $(this) ); } );
    70 });
    70 });