当前位置: 代码迷 >> Web前端 >> 请求服务器数据,解决IIE缓存有关问题
  详细解决方案

请求服务器数据,解决IIE缓存有关问题

热度:90   发布时间:2012-09-09 09:27:54.0
请求服务器数据,解决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);
}
}
  相关解决方案