Block Group: | Browser API |
Icon: |
Allows your project to store information in the user’s browser, over multiple sessions and browser windows.
For information on using dataflow blocks, see Dataflow.
These properties can take input and give output.
key sets or returns the key for a key-value pair.
global specifies whether this block sets and returns the global or non-global value for the key.
value sets or returns the value for a key-value pair.
This is a basic use of the block.
This section covers how to pass a value into a Local Storage block using JavaScript.
Changes to value from JavaScript do not take effect if the JavaScript is in the developer console for the same DGLux5 frame. Changes take effect only if the JavaScript is in an IFrame, or a different .dg5
file from the Local Storage block.
To pass a value into a Local Storage block:
Use the following syntax to append code to define the value:
window.localStorage['dg:project:key1'] = "value1";
project
with the name of the project. If global is set to TRUE, project
is blank, so the syntax is dg::key1
.key1
with the name of the key. This must match the key property of the Local Storage block.value1
with the value of the key.This thread in the DGLogik Community Forum addresses the local storage block: