The following block contains JSON data which will be used in a later block.
In this case, the object in the fence block will be stored in a data property
named doc
. The block's source is displayed since the block attribute show
is set on the block.
{ "title": "nenb example - set-title-with-data (updated w/json)" }
The full source for the block is show below.
```json { "title": "nenb example - set-title-with-data (updated w/json)" } ``` * name doc * show
The block below uses the data stored by the json
block above to set the
window title.
// set the document title from property set previously document.title = data.doc.title
This is the same data as from the json
block above, but in toml
format.
title2 = "nenb example - set-title-with-data (updated w/toml)"
Again, a JavaScript block is used to set the title from a data block previously set in the document.
// set the document title from property set previously document.title = data.doc2.title2