关于加载其他网站图片的问题??

问题

我之前能够通过

 this.spriteFrame = new cc.SpriteFrame("http://img3.imgtn.bdimg.com/it/u=826828499,2412343960&fm=23&gp=0.jpg");

正常加载其他网站的图片。
今天突然发现,在浏览器上,出现以下错误

Access to Image at 'http://img3.imgtn.bdimg.com/it/u=826828499,2412343960&fm=23&gp=0.jpg' from origin 'http://localhost:7456' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:7456' is therefore not allowed access. The response had HTTP status code 403.

在模拟器上,还是不能加载,也没有报错。

目标

接入SDK后,获得玩家头像的url,然后在游戏加载显示

ccc版本

v1.4.2

有没有好的解决办法?

浏览器直接打开这个地址,显示403 forbidden,说明服务器禁止了。

换成这个试试
http://pic62.nipic.com/file/20150319/12632424_132215178296_2.jpg

试试这个

 

这个图Web不行(WebGL不行,Canvas有报错但能加载),模拟器可以。因为它的Header中没有允许跨域的字段,所以浏览器不允许加载。如果想在浏览器中加载,参考http://forum.cocos.com/t/url/42848/4

请问你是哪个版本的ccc。
我1.4.2在模拟器下不能显示,也无任务报错信息。是否需要其他额外配置

我刚才用的是1.5.1-beta.2,换1.4.2试了下也正常:

cc.Class({
    extends: cc.Component,
    properties: {
        sprite: cc.Sprite
    },
    onLoad: function() {
        cc.loader.load({ url: "http://pic62.nipic.com/file/20150319/12632424_132215178296_2.jpg", type: "jpg" }, (err, texture) => {
            this.sprite.spriteFrame = new cc.SpriteFrame(texture);
        })
    }
});

是我调用方式有问题,问题解决了