請求服務器數據,解決IIE緩存問題

/**
* 加上隨機數, 解決ie緩存的問題
* prefix 前綴,例如服務器地址
* endfix 後綴,如隨機數,或者flash的版本號
* */
public static function randomUrl(url:String, prefix:String="", endfix:String=""):String{

endfix = StringTools.equals(endfix, "") ? Math.random().toString() : endfix;

return prefix + url + "?_key=" + endfix;
}

/**
* 請求跨域策略文件 BASEURL 服務器地址
* */
public static function loadPolicyFile(domain:String=null):void{
if ( domain == null){
domain = BASEURL + "ibp/crossdomain.jsp";
}
try{
flash.system.Security.loadPolicyFile(domain);
}catch(e:Error){
trace(e.message);
}
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章