Skip to content

Commit 6a78272

Browse files
committed
add a CORS note
1 parent 8a3d4ea commit 6a78272

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

website/templates/docs/instantiate-a-timeline.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ <h2 class="header-story" id="add-javascript">Integrate Timeline using Javascript
5656
<div class="column-12">
5757
<h3 id="in-page-json">Creating your own JSON</h3>
5858
<p>
59-
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
59+
If you are retrieving JSON from a URL, you can simply<sup>*</sup> 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
6060
object as the second argument.
6161
</p>
6262
<p>
6363
Create the JSON according to <a href="json-format.html">our specifications</a> and then change step 3 to look like this.
64-
<pre class="prettyprint lang-html">
64+
<pre class="prettyprint lang-html">
6565

6666
&lt;script type="text/javascript"&gt;
6767
// make_the_json() is some javascript function you've written
@@ -73,6 +73,8 @@ <h3 id="in-page-json">Creating your own JSON</h3>
7373
</pre>
7474

7575
</p>
76+
<p class="note"><strong><sup>*</sup>"Simply"</strong> 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".
77+
</p>
7678
</div>
7779
<div class="column-12">
7880
<h3 id="options">Configuring TimelineJS options</h3>

0 commit comments

Comments
 (0)