- var d1 = $.Deferred();
- var d2 = $.Deferred();
- $.when( d1, d2 ).done(function ( v1, v2 ) {
- console.log( v1 ); // "Fish"
- console.log( v2 ); // "Pizza"
- });
- d1.resolve( "Fish" );
- d2.resolve( "Pizza" );
sequential using jquery ?
Please check this code . Its run.
- var d1 = $.Deferred();
- var d2 = $.Deferred();
- $.when( d1, d2 ).done(function ( v1, v2 ) {
- console.log( v2 ); // "Pizza"
- console.log( v1 ); // "Fish"
- });
- d1.resolve( "Fish" );
- d2.resolve( "Pizza" );
I will change console.log(v1); My output pizaa , fish
But i want to output same , for eg -fish and pizaa . How it's possible. Please solve this
Jaimin ShethiyaPosted Oct 10, 2019, 7:40 AM
If you ahve changed the console statement then also you have to change the resolve statement then you have to achieve same output.
below is the code, can you please check that and let me know it's working or not for you.
Thanks
Sourabh DhimanPosted Oct 10, 2019, 8:37 AM