New to javascript and really lost

New to javascript and really lost

in API Development

Posted by: jasonb.4198

jasonb.4198

So, I’ve been trying to teach myself javascript and JSON. Not seeming to get anywhere. Hopefully someone can post a <script> … </script> section to display the name of achievement 2258 in an alert box? I think if I can at least get one valid section of test code, I can adapt and expand.

Thanks.

New to javascript and really lost

in API Development

Posted by: darthmaim.6017

darthmaim.6017

Here ya go:

fetch(‘https://api.guildwars2.com/v2/achievements/2258’)
.then(response => response.json())
.then(data => alert(data.name));

(edited by darthmaim.6017)

New to javascript and really lost

in API Development

Posted by: jasonb.4198

jasonb.4198

Thank you, thank you.
I’m at least able to get data back and start to modify the code.