I'm trying to store a hotspot “section” argument in the browser's sessionstorage.
Does anyone know how to do this in xml directly?
Thanks for the help
Best regards
Vincent
is it possible to sock an argument in the browser's sessionstarage with an action?
-
-
Hi,
you can use jscall() and jsget() actions for example:JavaScript
Display More<style name="button" padding="4 8" bgcolor="0xcccccc" color="white" width="100%"/> <layer type="container" x="200" y="200" flowchildren="v" childmargin="10" childflowspacing="10" width="200" bgborder="1"> <layer name="myinput" type="text" text="mystring" editable="true" padding="4 8" bgcolor="0xccccff" color="white" width="100%"/> <layer name="save" type="text" text="SAVE to sessionstorage" onclick="save_session" style="button"/> <layer name="load" type="text" text="LOAD from sessionstorage" onclick="load_session" style="button"/> <layer name="remove" type="text" text="REMOVE from sessionstorage" onclick="remove_session" style="button"/> </layer> <action name="save_session"> jscall(calc('sessionStorage.setItem("section", "'+get(layer[myinput].text)+'");')); </action> <action name="load_session"> jsget(section,'sessionStorage.getItem("section")'); set(layer[myinput].text, get(section)); </action> <action name="remove_session"> jscall('sessionStorage.removeItem("section");'); set(layer[myinput].text, ''); </action>
-
Thanks
Is perfect
Best regards
Vincent
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!