CreateJS / PreloadJS

PreloadJS makes preloading assets & getting aggregate progress events easier in JavaScript. It uses XHR2 when available, and falls back to tag-based loading when not.
http://createjs.com/
MIT License
2.88k stars 764 forks source link

Issue with LoadQueue basePath #254

Open dill0wn opened 6 years ago

dill0wn commented 6 years ago

There is a nearly identical issue that's two years old up here, but I'm having the exact same issue with the 1.0.1 release here: https://github.com/CreateJS/CreateJS/releases/tag/v1.0.1

When using the basePath property in conjunction with a manifestloader, it only seems to apply to the manifest, and not the manifests contents.

I have folder structure similar to the following:

http://localhost/games/mygame.html
http://localhost/cdn/mygame/assets/manifest.json
http://localhost/cdn/mygame/assets/data/somedata.json

So i do

var loader = new createjs.LoadQueue(false, "http://localhost/cdn/mygame/");
loader.loadManifest(
    { id: 'myManifest', src: 'assets/manifest.json', type: 'manifest' }, 
    true 
    //, "http://localhost/cdn/mygame/" // I've tried both places
);

and the manifest looks like:

{
    "manifest": [{
        "id": "someData",
        "src": "assets/data/somedata.json",
        "type": "json"
    }]
}

It loads the manifest, but then fails to load any of the contents, getting 404 instead. The url attempted was http://localhost/games/assets/data/somedata.json

Is there something obvious I'm doing wrong?

Unfortunately, the hosting situation is outside of my control, so I do not think I can change the path structure.