This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Needless to say I parse the text and get the info I need to make my own mini-armory.
now on my page sometimes when I click on a certain user, everything will work just fine, then on the other hand sometimes it won't but if I close the browser and try that same character's armor again, it works fine.
I was just wondering if AJAX sometimes just gets overloaded and bombs out, or if there is some special code I need to put in to insure my responseText is returned.
I mean, it simi-works in ff, enough for you to get the concept of what I'm doing. The armor image thumbnails are sent back in one ajax call, the health/mana in one and their main professions (mining,skinning,enchanting and etc) in one and the stats on that piece of gear when you hover in another(the stats are supposed to pop up in a div when you onmouseenter, but doesn't seem to work in ff).
Sometimes it all works fine and then sometimes the health won't show up, or the amor won't change for that person.
If AJAX doesn't tend to mess up sometimes, then I'm obviously going about this the wrong way... here is an example of my ajax functions:
I've done AJAX before, but I guess I could've bit the dust on this try.
thanks again,
Justin
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
6
posted
0
if you use get, I am guessing you are having caching issues. Maybe a request failed/came back incomplete and it keeps serving that back to you.
Eric
Justin Fox
Ranch Hand
Joined: Jan 24, 2006
Posts: 802
posted
0
is it possible to clear the cache using javascript or by some other means? Having to re-open the browser is a pain.
Thanks
Peter Jennings
Greenhorn
Joined: Sep 25, 2009
Posts: 9
posted
0
Justin Fox wrote:is it possible to clear the cache using javascript or by some other means? Having to re-open the browser is a pain.
Thanks
The traditional solution is to append random characters to the URL you are getting so that the browser won't recognize it as being the same URL.
google: prevent ajax cache for many solutions.
If you are using jquery, you can use this to prevent caching of ajax gets.
Justin Fox
Ranch Hand
Joined: Jan 24, 2006
Posts: 802
posted
0
Cool, I just appended "&ms="+ new Date().getTime();
to all my request object's urls.
Interesting demo, Justin. Do you have a bigger purpose planned for this or are you just using this to learn? I mean, you are just duplicated the official armory.
Justin Fox
Ranch Hand
Joined: Jan 24, 2006
Posts: 802
posted
0
Well it's for our guild site, rather that going to wowarmory, searching a guild members name, then looking for the corresponding realm, you can just go to the guild site, click on members, then look at everyone's gear and class etc..
The only think I can't get to work properly is the Armor-Stats popup in firefox, it keeps flashing on and off really fast. In IE it works good though.
Just a way of representing the same data in an more accessible way for a particular guild.
Using a decent JavaScript library will help you quite a bit, although when bad things happen you may still need to know what's going on under the hood. But the library will help deal with cross-browser issues and make understanding the code much, much easier.
If for no other reason people are more likely to help you if the code is short :)