Jump to content

XmlHttpRequest error in babylon.js


shaharyar.ahmed
 Share

Recommended Posts

I was following the tutorial http://blogs.msdn.com/b/eternalcoding/archive/2013/06/28/babylon-js-how-to-load-a-babylon-file-produced-with-blender.aspx to use ".babylon" files in babylon.js. I downloaded the source files and uploaded them to http://www.000webhost.com/ (a free web hosting site).

 

I also added the MIME types to the ".htaccess" file:

AddType application/fx .fxAddType application/babylon .babylonAddType application/babylonmeshdata .babylonmeshdata
But when I tried "loadScene.html" file, I got the error: http://i.stack.imgur.com/xJ5cE.png
 
Then I asked about this error on stackoverflow.com and found that I need to add header to make cross origin requests, then I add this line to ".htaccess" file:
Header add Access-Control-Allow-Origin "*"

But still I have the same errors. Please help me sort it out, I've no idea what to do and how to do.

 

Link to comment
Share on other sites

Babylon will first try to load a manifest file associated to your babylon scene, as described here : https://github.com/BabylonJS/Babylon.js/wiki/Caching-the-resources-in-IndexedDB

I guess the error you got is because this file does not exists in your folder.

 

Can you try to add this file to check if this error disapears ?

Link to comment
Share on other sites

Sorry, my last post was not very clear... 

Can you please add  on your FTP a file called : 

Res-Buiilding-3_archive3d.babylon.manifest

This file should contain only one line : 

{ "version" : 1, "enableSceneOffline" : true, "enableTexturesOffline" : true }

Please add this file and check if this error still appears.

Link to comment
Share on other sites

When you load a custom scene, Babylon will first try to retrieve the scene manifest file. This manifest file is used to enable offline support, as described here : https://github.com/BabylonJS/Babylon.js/wiki/Caching-the-resources-in-IndexedDB. As you can see, enable offline support is not mandatory.

The manifest file is loaded via a XHR send request, but as it not mandatory, the XHR request can fail.

   ==> In this case, an error message is displayed (like the one you got previously), and the scene is retrieved from the webserver. The error message only indicates the manifest file has not been found.

 

If the manifest file exists, the scene is loaded from a IndexedDB database (if possible).

 

Don't forget to tag your post as "resolved" :)

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...