
March 6th, 2013, 10:15 AM
|
|
Registered User
|
|
Join Date: Mar 2013
Posts: 1
Time spent in forums: 31 m 50 sec
Reputation Power: 0
|
|
|
Render Json file in Webbrowser
Hello,
I'm trying to render a Json file that was converted from a obj file (a cube made in blender) on my webbrowser.
I alraedy have the following code
PHP Code:
<!DOCTYPE html> <html> <head> <script> function loadDatos() { var xobj = new XMLHttpRequest(); xobj.overrideMimeType("application/json"); xobj.open('GET', 'part1.json', true); xobj.onreadystatechange = function () { if (xobj.readyState == 4) { alert('test'); var jsonTexto = xobj.responseText; alert(jsonTexto); //ProcessTheData(jsonTexto); } } xobj.send(null); } </script> </head> <body> <h1>My First JavaScript</h1> <p id="demo">This is a paragraph.</p> <button type="button" onclick="loadDatos()">Display Date</button> </body> </html>
When I press on the button my webbrowser shows the content of the jsonfile.
But now I want to see the cube.
How do I need to do that?
Thanks!
|