How to obtain info from browser in revWeb app
kee at kagi.com
Fri Jun 3 19:08:06 CDT 2011
var urlParams = window.location.search.substring(1); <!-- I added this line to the HTML generated by revWeb to get the CGI parameters -->
var ie = (agt.indexOf("msie") != -1);
var ns = (navigator.appName.indexOf("Netscape") != -1);
var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
var mac = (agt.indexOf("mac")!=-1);
In my stack I created a button with this script:
do "result = urlParams" in browser
put result() into theUrlParams
answer theUrlParams with "OK"
do "result = agt" in browser
put result() into theAgent
answer theAgent with "OK"
When I call the revWeb page as though it is a CGI with these parameters added to the link:
The first answer dialog displays:
and then the second displays:
mozilla/5.0 (macintosh; intel mac os x 10.6; rv:2.0.1) gecko/20100101 firefox/4.0.1
Thank you to Mike and Andre.
More information about the use-livecode