Q:

load images assets from other server in phaser

I am trying to load an image from the report server but it did not showing up when i add it into sprite by this.
preload: function () {
    game.load.baseURL = 'http://somthing.com/';
    game.load.crossOrigin = 'anonymous';
},
create: function () {
    var data = new Image();
    data.src = sessionStorage.getItem("game_icon0");
    game.load.image('newIcon','game_icon0',data);
    game.add.sprite(0, 0, 'newIcon');
},

When i try to load it into game it did not show up there. please help

A:

First, while it may work as-is, best practices state you should move your asset loading into the preload function. This ensures that they're available before they're used.
The next issue is loading the image remotely. If the session item already has the URL of the item I would think you should be able to load it directly.
preload: function () {
    game.load.baseURL = 'http://somthing.com/';
    game.load.crossOrigin = 'anonymous';
    game.load.image('newIcon',sessionStorage.getItem("game_icon0"));
},

create: function () {
    game.add.sprite(0, 0, 'newIcon');
},

It might make sense to handle the grabbing of information from the session in some other way, such as setting variables or creating an object, depending upon how many API calls you need to make.

