Is Jquery Ajax compatible with Babylon.js?

So here is the thing, I need to parse JSON data to my project and I’m trying to use Ajax with the async turned off, everything seems to be fine untill I find that I can’t use “enableEdgesRendering()” function and then I get this error

image.

Ok so I take out the edge rendering function and for my surprise it gets the vertices as intended in the JSON file but with a catch… the faces are invisible or are not rendered with no error thrown.

Imgur

this is the ideal case scenario:

Imgur

I would try to send some scripts if needed but for real, is there any way I can parse synchronous JSON objects to my project? a solution or an alternative is accepted.

I think you don’t need jquery)) for this because you can use lowest level functions https://xhr.spec.whatwg.org/
And Introduction to fetch()  |  Web  |  Google Developers
I use fetch for requests but you can use something like axios

Fetch? I tried using fetch but I got a lot of problems because of the async characteristics of fetch, can you use fetch in a synchronous way?

getting any separate data need some time and after this time you get full and you can use your data. jquery ajax its sugar for xmlhttprequestand i think your problem you dont wait sceneReady or something like this. better if you make playground with your question

I found my error in the end, the parsers were working well, it was that “b.toFixed” is a float function not a String and the JSON parsers always parse in string. It took me a while but I made it work in the end!

1 Like