Tell us what’s happening:
So I have been making the bar chart separely from the api request for now since I found it easier. In code pen I am able to get a response from the api when i bind it to a click function but when i try to load it in with the page with window onload or document onload i get this error.
A cookie associated with a cross-site resource at https://cdpn.io/ was set without the SameSite
attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with SameSite=None
and Secure
. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.
I tried looking it up but am not sure how to solve this any help would be appreciated, also here is my code pen if anyone wants to take a look at it
Your code so far
window.onload = function(){
var json;
// Add your code below this line
fetch('https://raw.githubusercontent.com/freeCodeCamp/ProjectReferenceData/master/GDP-data.json')
.then(response => response.json())
.then(data => {
json = JSON.stringify(data.data);
});
// Add your code above this line
console.log(json);
};
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36
.
Challenge: Visualize Data with a Bar Chart
Link to the challenge: