You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here the same problem with [Cross-Origin Request](https://developer.mozilla.org/en/http_access_control) can appear.
259
-
If the web server configuration cannot be changed, just copy JSROOT to the web server itself.
257
+
Here the same problem with [Cross-Origin Request](https://developer.mozilla.org/en/http_access_control) can appear. If the web server configuration cannot be changed, just copy JSROOT to the web server itself.
Such JSON representation generated using the [TBufferJSON](http://root.cern.ch/root/html/TBufferJSON.html) class.
337
+
Such JSON representation generated using the [TBufferJSON](http://root.cern.ch/root/html/TBufferJSON.html) class. One could create JSON file for any ROOT object directly, just writing in the code:
338
+
339
+
...
340
+
obj->SaveAs("file.json");
341
+
...
342
342
343
343
To access data from a remote web server, it is recommended to use the [XMLHttpRequest](http://en.wikipedia.org/wiki/XMLHttpRequest) class.
344
344
JSROOT provides a special method to create such class and properly handle it in different browsers.
@@ -347,12 +347,12 @@ For receiving JSON from a server one could use following code:
347
347
var req = JSROOT.NewHttpRequest("http://your_root_server:8080/Canvases/c1/root.json", 'object', userCallback);
348
348
req.send(null);
349
349
350
-
In the callback function, one gets JavaScript object (or null in case of failure)
350
+
In the callback function one gets JavaScript object (or null in case of failure)
351
351
352
352
353
353
### Objects drawing
354
354
355
-
After an object has been created, one can directly draw it. If somewhere in a HTML page there is a`<div>` element:
355
+
After an object has been created, one can directly draw it. If HTML page has`<div>` element:
356
356
357
357
...
358
358
<div id="drawing"></div>
@@ -383,8 +383,6 @@ To correctly cleanup JSROOT drawings from HTML element, one should call:
383
383
384
384
JSROOT.cleanup("drawing");
385
385
386
-
Many examples of supported ROOT classes and draw options can be found on [JSROOT examples](https://root.cern.ch/js/latest/examples.htm) page.
387
-
388
386
389
387
### File API
390
388
@@ -399,7 +397,12 @@ For example, reading an object from a file and displaying it will look like:
399
397
JSROOT.draw("drawing", obj, "colz");
400
398
});
401
399
});
400
+
401
+
Similar example with JSON file:
402
402
403
-
403
+
var filename = "http://jsroot.gsi.de/files/th2ul.json.gz";
0 commit comments