0
|
1 //>>excludeStart("exclude", pragmas.exclude);
|
|
2 define([ "shoestring", "ajax/ajax" ], function( shoestring ) {
|
|
3 //>>excludeEnd("exclude");
|
|
4
|
|
5 /**
|
|
6 * Load the HTML response from `url` into the current set of elements.
|
|
7 *
|
|
8 * @param {string} url The url to GET from.
|
|
9 * @param {function} callback Callback to invoke after HTML is inserted.
|
|
10 * @return shoestring
|
|
11 * @this shoestring
|
|
12 */
|
|
13 shoestring.fn.load = function( url, callback ){
|
|
14 var self = this,
|
|
15 args = arguments,
|
|
16 intCB = function( data ){
|
|
17 self.each(function(){
|
|
18 shoestring( this ).html( data );
|
|
19 });
|
|
20
|
|
21 if( callback ){
|
|
22 callback.apply( self, args );
|
|
23 }
|
|
24 };
|
|
25
|
|
26 shoestring.ajax( url, { success: intCB } );
|
|
27 return this;
|
|
28 };
|
|
29
|
|
30 //>>excludeStart("exclude", pragmas.exclude);
|
|
31 });
|
|
32 //>>excludeEnd("exclude");
|