AS3当我用装载机,我总是得到则httpStatus code 200事件虽然则httpStatus code。在谷歌浏览器304 [英] As3 When i use Loader,i always get httpstatus code 200 event though the httpstatus code in google chrome is 304

查看:262
本文介绍了AS3当我用装载机,我总是得到则httpStatus code 200事件虽然则httpStatus code。在谷歌浏览器304的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在AS3,我用

_loader.contentLoaderInfo.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHttpStatus);

检测装载机的则httpStatus code。在回调函数则httpStatus code为200时,则httpStatus code。在谷歌浏览器显示的是完全304。

to detect the httpstatus code of Loader. In the callback function the httpstatus code is 200 when the httpstatus code show in google chrome is exactly 304.

推荐答案

使用随机数生成的新的联系,避免缓存效果

Use a random number to generate "new" links and avoid the cache effect

    var loader:URLLoader = new URLLoader();
    var noCache:Number = Math.random()
    loader.addEventListener(
        HTTPStatusEvent.HTTP_STATUS, 
        function(e:HTTPStatusEvent):void {
            trace('http status : ' + e.status)
        } 
    )
    loader.load(new URLRequest('http://www.example.com?c='+noCache));

这篇关于AS3当我用装载机,我总是得到则httpStatus code 200事件虽然则httpStatus code。在谷歌浏览器304的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆