Home  >  jQuery

Example of deferred.then() in jQuery

April 30, 2013
deferred.then() adds a handler to itself and this handler will be called when the deferred object will be resolved or rejected or keep on progress. In all these scenario deferred.then() calls the added handler.
Find the example.

<!DOCTYPE html>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
	var defer = $.Deferred();
	defer.then(function( value ) {
	    $( "p" ).html('You are at '+ value +' page');
    defer.resolve( 'jQuery' );



You are at jQuery page

©2022 concretepage.com | Privacy Policy | Contact Us