Hi,
there is a button, and a "link/href" property.
i have a variable like [the_url] and when i put it there it works and when user click button he will go to that link.
now i want open that link in new tab, i spend almost whole day but cant make it...
anyone know how to do it?
Thanks
[SOLVED] Open link in new tab
Moderator: Neosoft Support
[SOLVED] Open link in new tab
Last edited by noyzen on Fri Mar 30, 2018 9:20 am, edited 1 time in total.
old Neobook user, and now Neo AppBuilder.
i'm Graphic Designer and a Non-Programmer!
i'm Graphic Designer and a Non-Programmer!
Re: Open link in new tab
noyzen:
1) Leave the link/href property of the Button empty.
2) Place these commands in the Code section (tab) for the Button ...
... just replace https://www.google.com with the URL of your target webpage.
1) Leave the link/href property of the Button empty.
2) Place these commands in the Code section (tab) for the Button ...
Code: Select all
BeginJS
window.open('https://www.google.com','_blank');
EndJS
Re: Open link in new tab
Thank you, it works.
but i cant change url with variable...
BeginJS
window.open([ad_url],'_blank');
EndJS
and
BeginJS
window.open('[ad_url]','_blank');
EndJS
both fail
but i cant change url with variable...
BeginJS
window.open([ad_url],'_blank');
EndJS
and
BeginJS
window.open('[ad_url]','_blank');
EndJS
both fail
old Neobook user, and now Neo AppBuilder.
i'm Graphic Designer and a Non-Programmer!
i'm Graphic Designer and a Non-Programmer!
Re: Open link in new tab
noyzen:
Of course you can set [neoVarURL] anywhere else in your App; just make sure it is setup as a global (not local) variable.
To learn more about variables, read the Help file ... and search the General NeoAppBuilder Discussion Forum.
That is because you can not use regular NeoAppBuilder variables (i.e. those wrapped within [ and ] ) with javascript commands (i.e. commands used between BejinJS and EndJS ... you have to copy values from one namespace to another ... this is done using $rootspace like in the example below ...but i cant change url with variable...
Code: Select all
SetVar [neoVarURL] "https://www.google.com"
BeginJS
jsVarURL= $rootScope.neoVarURL;
window.open(jsVarURL,'_blank');
EndJS
To learn more about variables, read the Help file ... and search the General NeoAppBuilder Discussion Forum.
Re: [SOLVED] Open link in new tab
Thank you very much, it works great!
i mark this topic as solved so it may help other people too.
Regards,
i mark this topic as solved so it may help other people too.
Regards,
old Neobook user, and now Neo AppBuilder.
i'm Graphic Designer and a Non-Programmer!
i'm Graphic Designer and a Non-Programmer!