Callback page redirect
3 posts
• Page 1 of 1
Callback page redirect
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?
Is there a built-in way to do this?
Davin
- Davin Church
- Posts: 2
- Joined: Sun Jul 25, 2021 2:56 am
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
I hope this helps!
/Brian
-
Brian|Dyalog - Posts: 120
- Joined: Thu Nov 26, 2009 4:02 pm
- Location: West Henrietta, NY
Re: Callback page redirect
Excellent! Thanks, Brian. My JS is very weak and wasn't even sure how to approach that.
Davin
- Davin Church
- Posts: 2
- Joined: Sun Jul 25, 2021 2:56 am
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group