TIP: Opening Web Pages
Posted: Mon Dec 29, 2003 8:33 pm
(1) You can open up a web page using "application.showURL()." A typical example would be:
application.showURL('http://www.mapquest.com');
(2) You can display a map of my address -- 8120 Woodmont Avenue, Bethesda, MD:
application.showURL('http://www.mapquest.com/maps/map.adp?country=US&address=8120%20Woodmont&city=Bethesda&state=MD&submit=Get+Map');
(3) You can use Servoy record information to build your string dynamically so that you can display a map for each record:
//build connection string
var connection_string =
'http://www.mapquest.com/maps/map.adp?' +
'country=' + escape(field_country) +
'&address=' + escape(field_address) +
'&city=' + escape(field_city) +
'&state=' + escape(field_state) +
'&submit=Get%20Map'
//send string to default browser
application.showURL(connection_string);
The TIP here is to use the javascript function "escape()" to ASCII encode the string before sending it to the browser. For example, instead of sending "&address=8120 Woodmont" (which would fail) this portion of the string would have the space encoded to send "&address=8120%20Woodmont".
- david
application.showURL('http://www.mapquest.com');
(2) You can display a map of my address -- 8120 Woodmont Avenue, Bethesda, MD:
application.showURL('http://www.mapquest.com/maps/map.adp?country=US&address=8120%20Woodmont&city=Bethesda&state=MD&submit=Get+Map');
(3) You can use Servoy record information to build your string dynamically so that you can display a map for each record:
//build connection string
var connection_string =
'http://www.mapquest.com/maps/map.adp?' +
'country=' + escape(field_country) +
'&address=' + escape(field_address) +
'&city=' + escape(field_city) +
'&state=' + escape(field_state) +
'&submit=Get%20Map'
//send string to default browser
application.showURL(connection_string);
The TIP here is to use the javascript function "escape()" to ASCII encode the string before sending it to the browser. For example, instead of sending "&address=8120 Woodmont" (which would fail) this portion of the string would have the space encoded to send "&address=8120%20Woodmont".
- david