Closed andyward closed 9 years ago
From @CBenghi on August 31, 2015 10:24
Hello, I don't quite understand the problem you have. I know most people are using Vs2013 for the development of the web viewer, and as far as I know it should all be working, if in doubt maybe download develop branch, which is the one generally under development. Also it's not clear why you are posting this issue under the WindowsUI project. Can you clarify? Thanks, Claudio
This issue was moved to xBimTeam/XbimWebUI#34
Moved this to WebUI as a more suitable repo.
It sounds like you're requesting JS resources across origins. i.e. your website is requesting (via AJAX) the content from a different domain (or endpoint). Take a look at this CORS summary
I'm not sure why you'd see a difference between VS2010 and VS2013 - are you using the same Browser in each?
To fix you'll need to implement a CORS policy on the API side (serving the JS content). See http://enable-cors.org/server.html for some examples.
Hi, Thanks for your prompt reply. The problem is I can not load the model into the viewer when I debugged in visual studio 2013 using Chrome.I got "Uncaught Failed to fetch binary data from server. Server code:404. This might due to CORS policy of your browser if you run this as a local file." After I implementing a CORS policy on IIS 6.0, I still can not display the model in the viewer. And I got "Uncaught TypeError:Can not read property '_the model' of undefined".
@zhengcongyin So did you resolve the CORS issue? It sounds like you did, but now you have a separate issue.
It's hard to see what's going on without some repro steps. Can you provide a sample demonstrating the issue? Are you sure you're calling xViewer.load(...) ?
Also check out the examples at http://xbimteam.github.io/XbimWebUI/
Hi @zhengcongyin ,
as all the code is just a pure HTML + JS it is pretty much Visual Studio independent. The only thing I can think of is different directive for a static files. Wexbim file is our own so it is not treated as a static file by default. There is a directive in WeXplorer project config file which makes it static file for IIS Express.
VS2013 and VS2013 uses IIS Espress to debug and run web projects whereas VS2010 uses Visual Studio Development Server According to this blog post it is possible to switch to IIS Express. I would give it a try.
Closing
Hello all,
I cannot find a solution to this, I have this error (not 404 !):
Failed to fetch binary data from server. Server code: 0. This might be due to CORS policy of your browser if you run this as a local file.
This happens also with both Edge, Firefox and Chrome browsers for the file "viewer3D.html" in the repository. Can you help on this? This error is new to me, it never happened before.
Duplicate of #287
From @zhengcongyin on August 30, 2015 4:17
I have tried to add the source code of webxbimUI in visual studio, I can not load the model and Json, and got a error "Failed to fetch binary data from server. Server code: 404'. This might be due to CORS policy of your browser if you run this as a local file". However, it works fine in Visual Studio 2010. Could you tell me how to fix this problem? Thanks,
Best, Zhengcong
Copied from original issue: xBimTeam/XbimWindowsUI#8