Requesting Dynamic HTML
Last updated
Last updated
ScriptyBuilder
supports injecting dynamically created scripts between statically stored scripts.
If the scriptContent
field of requests is not empty, then ScriptyBuilder
will use scriptContent
instead of fetching the script from a contract.
You can set different wrapping options for dynamically created scripts. For more about wrapping options please check .
Here we are requesting three.js
and some generative art named cubes
that depends on three.js
. By itself, cubes script does nothing. A controller script is created with on-chain values and it initiates cubes
script.
When it's controllerScript
becomes something like this:
Final output looks like this:
You can check this example(, ) which uses dynamic script to generate HTML files.