Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subsequent': 0.05; '(using': 0.07; 'cookie': 0.09; 'pages.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'similar,': 0.09; 'python': 0.11; 'changes': 0.15; '(note': 0.16; 'cookies,': 0.16; 'index.html': 0.16; 'message-id:@4ax.com': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject: ?': 0.16; 'code.': 0.18; 'load': 0.23; 'url:home': 0.24; 'script': 0.25; 'pass': 0.26; 'gets': 0.27; 'header:X-Complaints-To:1': 0.27; 'xml': 0.29; 'code': 0.31; 'cgi': 0.31; 'dom': 0.31; 'embed': 0.31; 'handled': 0.32; 'run': 0.32; 'plain': 0.33; 'something': 0.35; 'operations': 0.35; 'there': 0.35; 'interact': 0.36; 'doing': 0.36; 'charset:us- ascii': 0.36; 'received:76': 0.38; 'server': 0.38; 'ajax': 0.38; 'handle': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'users': 0.40; 'how': 0.40; 'full': 0.61; 'new': 0.61; 'browser': 0.61; 'information': 0.63; 'different': 0.65; 'request.': 0.70; 'internet': 0.71; 'jul': 0.74; 'explorer': 0.84; 'geo': 0.84; 'geolocation': 0.84; 'that),': 0.91; 'outcome': 0.93; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: GeoIP2 for retrieving city and region ? Date: Tue, 16 Jul 2013 20:51:39 -0400 Organization: IISS Elusive Unicorn References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-76-249-23-192.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1374022310 news.xs4all.nl 15875 [2001:888:2000:d::a6]:35550 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:50763 On Tue, 16 Jul 2013 22:43:35 +0300, ??????? declaimed the following: > >Lest say i embed inside my index.html the Javascript Geo Code. > >Is there a way to pass Javascript's outcome to my Python cgi script somehow? > >Can Javascript and Python Cgi somehow exchnage data? Using plain CGI is going to be painful -- since /everything/ is handled a whole new page request. You would have to handle session cookies, etc. Your "index.html" would attempt to run the JavaScript (note that some users may have JavaScript turned off -- how will you handle that), if it gets information it would have to do a "GET index2.html?lat=xxx?long=yyy" or something similar, which will result in a new page load on the user -- hopefully with a cookie set so you know NOT to run the geolocation code on subsequent pages. AJAX is a process to allow JavaScript on the browser to interact with a server (using XML data structures), and likely use DOM operations in the browser (and the last time I did something on this nature, I had to have different code for Internet Explorer vs Firefox, and don't know of Chrome/Opera share one of the others calls) to make changes on the web page without doing a full submit/render operation -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/