TransWikia.com

jQuery console loads twice in SharePoint

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);

}

enter image description here

console
enter image description here

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP