Changeset 24652 for trunk/wp-includes/js/wp-util.js
- Timestamp:
- 07/11/2013 12:20:36 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/wp-util.js
r24369 r24652 29 29 }); 30 30 31 // wp. xhr31 // wp.ajax 32 32 // ------ 33 33 // 34 34 // Tools for sending ajax requests with JSON responses and built in error handling. 35 35 // Mirrors and wraps jQuery's ajax APIs. 36 wp. xhr= {37 settings: settings. xhr|| {},36 wp.ajax = { 37 settings: settings.ajax || {}, 38 38 39 39 /** 40 * wp. xhr.post( [action], [data] )40 * wp.ajax.post( [action], [data] ) 41 41 * 42 42 * Sends a POST request to WordPress. … … 47 47 */ 48 48 post: function( action, data ) { 49 return wp. xhr.send({49 return wp.ajax.send({ 50 50 data: _.isObject( action ) ? action : _.extend( data || {}, { action: action }) 51 51 }); … … 53 53 54 54 /** 55 * wp. xhr.send( [action], [options] )55 * wp.ajax.send( [action], [options] ) 56 56 * 57 57 * Sends a POST request to WordPress. … … 71 71 options = _.defaults( options || {}, { 72 72 type: 'POST', 73 url: wp. xhr.settings.url,73 url: wp.ajax.settings.url, 74 74 context: this 75 75 });
Note: See TracChangeset
for help on using the changeset viewer.