I have written below code to fetch all the projects, however its not working after $.ajax call. However, strange thing is, if I put a debugger in developer toolbar and debug it for long time (including jquery file) before hitting F5, it works fine and brings all project names. Below is the code.
I replaced project server url with sharepoint list REST call and it works fine.
function getProjects() {
$.ajax({
url: "http://chnsharepoint02/PWA" + "/_api/ProjectServer/Projects",
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
success: function (data) {
success(data);
},
error: function (data) {
failure(data);
}
});}
async:falseto$.ajax()parameters to force execution.