Re: Capturing a var from JavaScript
Victor Subervi wrote: > It doesn't work. What I want is to capture winX and winY and use them in > python. How? Since you're still not heeding the advice from this article, please allow me to refer you to it again: http://catb.org/~esr/faqs/smart-questions.html -- Carsten Haese http://informixdb.sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list
Re: Capturing a var from JavaScript
Yeah, I know, but if I use CGI then I have to pass variables in the URL, and I was trying to avoid that. Thanks, V On Mon, Oct 19, 2009 at 12:50 PM, geremy condra wrote: > On Mon, Oct 19, 2009 at 11:41 AM, Victor Subervi > wrote: > > Hey, that's great! Can do it in python? Fantastic! How? How do I ping the > > browser and get the screen resolution in python? > > V > > One way would be to use CGI, or one of its many derivatives. A better way > would be to allow the client to do what the client does best, which is > render- ie, use javascript. > > Geremy Condra > -- http://mail.python.org/mailman/listinfo/python-list
Capturing a var from JavaScript
Hi; I have the following code: #!/usr/bin/python def getResolution(): print 'Content-Type: text/html\n' print ''' http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd'> var winX = screen.width; var winY = screen.height; ''' x = eval('document.write(winX)') #document.write('Your screen resolution is ' + winX + ' x ' + winY + ', which is below the recommended size for this application. If possible, please reset your screen resolution to 800 x 600 or higher. Thank you!'); print ''' ''' print x print ''' ''' getResolution() It doesn't work. What I want is to capture winX and winY and use them in python. How? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list