Pardon my newbie question, but I want an APL callback fn to redirect their browser to a new page, just like it was an <a> link that was clicked on. However it needs to be done under program control because the URL is being dynamically generated.
Is there a built-in way to do this?
Callback page redirect
- Brian|Dyalog
- Posts: 120
- Joined: Thu Nov 26, 2009 4:02 pm
- Location: West Henrietta, NY
Re: Callback page redirect
Hi Davin,
To redirect to a page from a callback function, just return some JavaScript to set location.href to the new URL.
I hope this helps!
/Brian
To redirect to a page from a callback function, just return some JavaScript to set location.href to the new URL.
Code: Select all
:Class index : MiPage
∇ Compose
:Access public
(Add _.Button'Click Me').On'click' 'callback'
∇
∇ r←callback
:Access public
r←Execute'location.href="https://dyalog.com"'
∇
:EndClass
/Brian
-
- Posts: 2
- Joined: Sun Jul 25, 2021 2:56 am
Re: Callback page redirect
Excellent! Thanks, Brian. My JS is very weak and wasn't even sure how to approach that.
Davin