Jump to content

Any chance of enabling CORS on example assets?


PAEz
 Share

Recommended Posts

Someone on here said thanks to me for putting an answer on JS Bin, because who doesnt like getting a live edit answer.

And so I think it'd be cool if you could transfer your examples to JS Bin to use as answer/question examples.

Thanks to the examples only being a single js file this is easy enough except things wont work because of the cross domain prob.

Setting a response header of 'Access-Control-Allow-Origin : "http://run.jsbin.com"' will make them work tho.

I know it works coz I use a homemade web accelerator through Chrome for images and got the gae app (the proxy part) to add that header and now the image stuff works but the other xhr stuff like text files doesnt and it only works for me so thats no good.

Would totally understand if the answer is no, this would more likely lead to some sort of abuse....in the very least could see people using your assets in Bins when needed and not just for phaser related stuff.

Anyways, it would be cool.

OH and if you do, I wouldnt mind putting a bunch of the samples up as all you really need to change is add a baseURL to the loader.

Link to comment
Share on other sites

You can link to the assets on our gametest.mobi domain and CORs is fully enabled on there already.

 

I don't want to spend lots of time uploading to jsbin because I cannot trust the site will be around and it's out of my control if it goes down. So what I plan to do is host my own jsbin site and use that instead (as jsbin is nicely open source this is quite easy to do).

Link to comment
Share on other sites

Really?

http://jsbin.com/phaser_starstruck/1/edit

...seems to say different ;)

XMLHttpRequest cannot load http://gametest.mobi/phaser/examples/assets/games/starstruck/level1.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://run.jsbin.com' is therefore not allowed access.

 

Sweet, that would be awesome!  Please keep it pretty close to the original if you can just so I can tweak my JS Bin extension to work with it ;)..hehe, only kidding, its all CodeMirror so it wouldnt matter.

But I really dont think Rem would let JS Bin die any time soon, hopefully the pay options will make sure of that.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...