Get variable value from URL when page-enter - Forum

Forum Navigation
You need to log in to create posts and topics.

Get variable value from URL when page-enter

hallo, i has URL below :

Untitled Application

I managed to get the value of the id variable by using the button with the script below:

beginjs
var url = window.location.href;
var regex = /id1=(\d+)/;
var match = url.match(regex);
var id1 = match ? match[1] : null;
console.log(id1);
$App.id = id1;

endjs

What I ask is how do I do it in the page-enter event ?.

Thank you

@suyonob

What I ask is how do I do it in the page-enter event ?.

At Design time ...

a) from the Pages Tab, select the page in question; the rectangle for the page will be selected
b) click on the Code Tab
c) place your code in the Page Enter Tab (at the bottom of the code section)

You may not need this Javascript code ... take a look at the GetURLParameter command listed on this page ... https://webhelp.visualneo.com/App.html

Other related App URL commands on the same Help file page that you might find interesting ...

GetAppURL
GetAppPath
GetAppBaseURL

luishp and suyonob have reacted to this post.
luishpsuyonob

Thank you gave :-)