On Tuesday, September 6, 2016 at 7:43:17 AM UTC-7, VAISHALI SHARMA wrote: > > Please reply.I am stuck at this for quite a long now :( >
I think you were entering your post as Massimo was entering his ... did his suggestion help? If you aren't using Chrome, your browser probably has an equivalent function; I know Firefox does. (In Chrome, you can get to the JS Console either by selecting "Developer Tools" from the main hamburger menu on the toolbar, or by right clicking on the page and selecting "inspect element", and then changing tabs in the tool display. FF also has the right click thing, but organizes the main menu a little differently.) /dps > On Friday, September 2, 2016 at 12:01:11 AM UTC+5:30, @brooks wrote: >> >> >> I am doing the following to pass the javascript variable from the view to >> the controller: >> ######default/rough2.html >> >> {{extend 'layout.html'}} >> >> <p id="demo"> >> >> </p> >> <script> >> >> var x=document.getElementById("demo"); >> jQuery(document).ready(function(){ >> geolocation(); >> }) >> >> function geolocation() { >> if (navigator.geolocation) { >> navigator.geolocation.getCurrentPosition(showPosition); >> >> } else { >> x.innerHTML = "Geolocation is not supported by this browser."; >> } >> } >> >> function showPosition(position) { >> var lat = position.coords.latitude; >> var lon= position.coords.longitude; >> >> >> ajax('{{=URL('default','rough3')}}'+'?lat='+lat+'&lon='+lon,[],':eval'); >> } >> >> </script> >> >> >> #####rough3() function >> def rough3(): >> lat1=request.vars.lat >> lon1=request.vars.lon >> ........................... >> ....................... >> >> But it is "not getting redirected to rough3.html".I do not understand >> why?Please help me with this.I am really troubled with this. >> > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.