Commander – Jam Death [Jd]
Fissure of Woe
Hello everyone,
After reading a bit through the API documentation the urge to start programming reappeared on my side.. So I did some work today and yesterday and thought it’d be handy to share my code with you guys?
I believe very new API programmers might find it handy for reference, and I hope that advanced API experts might correct me or provide me with some nice comments..
Anyway, here she goes (all is in one .html-file)..
That is a pretty good example of basic API use with jQuery. I would change a couple of things. You are using getElementById several places, since you are already using jQuery for the Ajax calls you could shorten document.getElementById(“some_id”).innerHTML=output; to $(“#some_id”).html(output);. Likewise, the $.ajax calls could be shortened and be made a little easier to read if you used the $.getJSON helper function instead.
Thank you for the feedback, much appreciated..
Indeed, the code needs to be optimalised some more (as you mention, use the JQuery functionality a bit more). Also I have to investigate some caching of the JSON-data, so that I don’t have to make constant API calls over Inet.. Work in progress, of course..
Ultimate plan is to get an overview like gw2thelazy for only my server (Fissure of Woe) where I can easily see the quest progress for the world bosses and our overall standing in WvW..
Indeed, the code needs to be optimalised some more (as you mention, use the JQuery functionality a bit more).
Actually, using more jQuery will increase overhead. It takes quite a bit for that to be noticeable and the consistency can be worth more in the long run from a perspective of maintenance but raw JavaScript always outperforms jQuery. You certainly wouldn’t notice the difference in this case, however.
It has been some months now. Did you update the code in your links, fx wrt to local caching?
What is the status of your project?
Not affiliated with ArenaNet or NCSOFT. No support is provided.
All assets, page layout, visual style belong to ArenaNet and are used solely to replicate the original design and preserve the original look and feel.
Contact /u/e-scrape-artist on reddit if you encounter a bug.