SharePoint Asked on October 25, 2021
I am having issues with this jQuery code. I don’t understand why my function runs twice. ‘dosomething’ and data shows up twice in the console and i’m not sure why. Please help.
$(document).ready(function() {
loadReportData();
})
function loadReportData(){
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('individual')/items",
type: "GET",
headers: {
"Accept":"application/json;odata=verbose"
},
success:dosomething,
error:dosomethingelse
})
}
function dosomething(data){
console.log("dosomething");
console.log(data);
}
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP