在'filtered.done()'正确之后,我认为'defer.resolve(5)',但为什么两者都有相同的结果。
cairo.ImageSurface
OffscreenWindow
答案 0 :(得分:0)
var defer = $.Deferred(),
filtered = defer.then(function( value ) {
return value * 2;
});
defer.resolve( 5 );
$("button").on( "click", function(){
filtered.done(function( value ) {
$( "p" ).html( "Value is ( 2*5 = ) 10: " + value );
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button>Filter Resolve</button>
<p></p>