NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: lkeyser on October 23, 2017, 05:11:29 AM
-
I'm just using to geolocation as an example for my question.
I can see the the values returning in the console of NT, but i don't know what I am doing wrong to retrieve the values back to the two local variables, in this case the longitude and latitude values.
GET /SetSessionValue?_Latitude_=-28.662680899999998&_Longitude_=23.853461&_Altitude_=0&_Accuracy_=30&_AltitudeAccuracy_=0&_Heading_=NaN&_Speed_=NaN&_LocationUnixTime_=1508764130&_LocationDate_=79192&_LocationTime_=4733027&_LocationError_=&_ajax_=1 HTTP/1.1
I have include a small example.
Thanks
Regards
Louis
Clarion 10
NT10
-
Hi Louis,
I'm not sure what you're trying to do in the example - or where you've put code etc.
When I run it, what am I looking for - what are you hoping to accomplish, and so on?
cheers
Bruce
-
Hi Bruce
I'm trying to get the variable values back from java script.
How do I "extract" the java return value "_Longitude_" and place it in my own session value for example.
Regards
-
Hi
Attached a new sample.
Got it working kinda, but I'm pretty sure I'm doing it wrong. Have to click the button a few times to get the parameters to return.
Regards
-
you have the following embed code;
p_web.Script('getLocation()')
p_web.SSV('LOC:Latitude',p_web.GSV('_Latitude_'))
p_web.SSV('LOC:longitude',p_web.GSV('_Longitude_'))
the problem is that you're thinking very synchronously here.
the first line;
p_web.Script('getLocation()')
is an instruction to the browser to run a Javascript function called getLocation.
I'll only _send_ this script when the request completes, so the next 2 lines are useless here.
hence the need to press the button multiple times...
cheers
Bruce