请求服务器数据,解决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);
}
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章