Skip to content
This repository has been archived by the owner on Jul 2, 2023. It is now read-only.

Dynamics #1

Closed
JerryI opened this issue Feb 14, 2023 · 2 comments
Closed

Dynamics #1

JerryI opened this issue Feb 14, 2023 · 2 comments

Comments

@JerryI
Copy link
Owner

JerryI commented Feb 14, 2023

Make a dynamic page like

<p>Live Factorial</p>
<?wsp Dynamic[ ?>
  <div style="color: red"><?wsp x! ?></div>
<?wsp , TrackedSymbols:>{x}] ?>

Use WS to send an updated result

@JerryI
Copy link
Owner Author

JerryI commented Feb 14, 2023

Dynamic[expr_String, OptionPattern[]] := Module[{uid = CreateUUID[]},
  (* add handlers, bind events*)

  Return["<div id=\""<>uid<>"\">"<>LoadPage[expr]<>"</div>"];
]

@JerryI
Copy link
Owner Author

JerryI commented Jun 22, 2023

Added as a part of WLJS.

@JerryI JerryI closed this as completed Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant