Skip to content

Commit aaf1143

Browse files
authored
Document that JSON embed files must be served over HTTP (#8632)
1 parent fe4f6c2 commit aaf1143

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

doc/how_to/export/embedding.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,6 @@ row.embed(states={slider: list(range(0, 12, 2))})
4545

4646
As you might imagine if there are multiple widgets there can quickly be a combinatorial explosion of states so by default the output is limited to about 1000 states. For larger apps the states can also be exported to json files, e.g. if you want to serve the app on a website specify the ``save_path`` to declare where it will be stored and the ``load_path`` to declare where the JS code running on the website will look for the files.
4747

48+
When the state is exported to json files, the generated HTML has to be served from an HTTP server rather than opened directly from disk. Browsers block access to local files (e.g. when the page is opened with a ``file://`` URL), so the embedded app cannot load its json files until it is served over HTTP, for example with ``python -m http.server``.
49+
4850
## Related Resources

0 commit comments

Comments
 (0)