Safari doesn't honor nocache. Safari is a jerk. Are you using Safari?


On 3/26/2010 3:35 PM, Nathan Mynarcik wrote:
That's similar to what I am doing. I know for a fact that the url doesn't already have a 
"?" in it.

I have no clue why on some visits, the colors and other xml data is not pulled. 
Then on a refresh it pulls them.

------Original Message------
From: Steven Sacks
To: Nathan Mynarcik
To: Flash Coders List
Subject: Re: [Flashcoders] NoCache XML
Sent: Mar 26, 2010 5:27 PM

It should always work.  Perhaps the url of the xml has a ? already in it?

public function nocache(url:String):String
{
        var d:Date = new Date();
        var nc:String = "nocache=" + d.getTime();
        if (url.indexOf("?")>  -1) return url + "&" + nc;
        return url + "?" + nc;
}


On 3/26/2010 2:27 PM, Nathan Mynarcik wrote:
Hey everyone,

I am loading in an external xml doc via

loadXML("url of xml");

To prevent browsers from caching the xml, I add at the end of the url string a 
Date object like:

loadXML("url of xml"+"?nocache="+new Date().getTime());

This sometimes works and other times doesn't. The xml is the backbone to the 
colors used in the UI of my site which goes black when the load doesn't work 
properly.

I have tried to add an IOERROREvent function to catch the error and then supply 
the url to the load function without the Date object appended.

Is there any checks or different directions I can take to prevent visitors from 
sometimes having to refresh until the xml gets loaded correctly?
Nathan Mynarcik
Interactive Web Developer
[email protected]
254.749.2525
www.mynarcik.com
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



Nathan Mynarcik
Interactive Web Developer
[email protected]
254.749.2525
www.mynarcik.com

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to