NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Ubaidullah on February 22, 2021, 08:36:35 PM
-
Hi Bruce,
I have a custom javascript file which displays some values on a NetWebForm.
Now, I need to use the session variable "language" to determine which values to display.
Since I cannot access the session variable from inside javascript, what would be the best way to get the value of "language" for my javascript code?
Thanks
&
Regards,
Ubaidullah Nubar.
-
a) add a function to your custom JavaScript to set a global JavaScript variable;
b) call the function from your program;
var globalLanguage='';
function setLanguage(lang){
globalLanguage = lang
}
then in your code somewhere
p_web.Script('setLanguage("' & p_web.GSV('lang') & '");')
-
Thanks Bruce.
That worked well.
Regards,
Ubaidullah Nubar.