Timeline for executeQueryAsync don't behave as synchronously
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 27, 2015 at 5:50 | comment | added | Azam Khan | @MohamedDerhalli Superb Explanation !! Appreciated. | |
Dec 27, 2015 at 5:42 | vote | accept | Milind | ||
Dec 26, 2015 at 22:03 | comment | added | Mohamed Derhalli | @Milind I am confused, you said your problem is not with loading the SP and that it was already loaded in the success function, but you get back undefined please explain more what's going on so we can help you. | |
Dec 26, 2015 at 16:00 | comment | added | Mohamed Derhalli | That's why all of the logic is included within the promise done, fail. there's nothing after it ;) | |
Dec 26, 2015 at 14:48 | comment | added | Danny '365CSI' Engelman |
any code after userPromise , I was not referring to the promise chain.
|
|
Dec 26, 2015 at 12:49 | comment | added | Mohamed Derhalli | @DannyEngelman userPromise code won't get executed until the return dfd is back with either resolve or reject, that's the whole purpose of promises.. | |
Dec 26, 2015 at 12:46 | comment | added | Danny '365CSI' Engelman | Well, jQuery and sharePoint are not a happy marriage... so use $.getScript only if you know what you are doing.. start learning at: spcaf.com/blog/sharepoint-javascript-context-dev-part-1 | |
Dec 26, 2015 at 12:43 | comment | added | Milind | Hi Thanx for the reply with answer as this line is not loading SP.SOD.executeFunc('sp.js', 'SP.ClientContext', getUserName); I am using this $.getScript("/_layouts/15/SP.Runtime.js", function () { $.getScript("/_layouts/15/SP.js", execOperation); }); That is main reason all mess is happening. Any solution for it | |
Dec 26, 2015 at 11:52 | comment | added | Danny '365CSI' Engelman |
strictly speaking userPromise will not 'wait' (as in execution stops there) Any code after it (in this case none) will execute. userPromise will 'listen' for an answer, then execute the chained done/fail/always etc. methods.
|
|
Dec 26, 2015 at 11:46 | history | edited | Danny '365CSI' Engelman | CC BY-SA 3.0 |
reformatted code with spaces
|
Dec 26, 2015 at 10:58 | history | answered | Mohamed Derhalli | CC BY-SA 3.0 |