From 6a78272866d86e10baf6c025941347e7bc946011 Mon Sep 17 00:00:00 2001 From: Joe Germuska Date: Mon, 18 Sep 2023 13:19:06 -0500 Subject: [PATCH] add a CORS note --- website/templates/docs/instantiate-a-timeline.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/website/templates/docs/instantiate-a-timeline.html b/website/templates/docs/instantiate-a-timeline.html index 8dec08b6f..e9cd9ad2b 100644 --- a/website/templates/docs/instantiate-a-timeline.html +++ b/website/templates/docs/instantiate-a-timeline.html @@ -56,12 +56,12 @@

Integrate Timeline using Javascript

Creating your own JSON

- If you are retrieving JSON from a URL, you can simply use that URL as the second argument, just as if you are loading data from a Google spreadsheet. If instead you have something in your page which will put the data together, you can also pass a JSON + If you are retrieving JSON from a URL, you can simply* use that URL as the second argument, just as if you are loading data from a Google spreadsheet. If instead you have something in your page which will put the data together, you can also pass a JSON object as the second argument.

Create the JSON according to our specifications and then change step 3 to look like this. -

+
 
         <script type="text/javascript">
             // make_the_json() is some javascript function you've written
@@ -73,6 +73,8 @@ 

Creating your own JSON

+

*"Simply" in one case: if you load the JSON file from the same server as the page where you're making the timeline. It's less simple if you try to load the JSON from another server, including the case where you try to use our authoring/embedding tool with JSON on your own server. Without getting into the weeds, this less simple case gets into CORS (cross-origin resource sharing), and for it to work, the server that hosts the JSON file needs to be configured to "share" with servers that have different domain names (the "cross-origin" part). Explaining this fully is beyond the scope of this documentation. Talk to the person who manages the JSON file server about "enabling CORS". +

Configuring TimelineJS options