lz.Browser
is the single instance of the class
lz.BrowserService
.
Interface to the browser via the runtime kernel
The lz.Browser
service provides access to the browser and player environment.
It includes methods to load URLs in the browser, and check the version of the player. For example:
Example 20. Using lz.Browser to launch another browser
<canvas
height
="140
" debug
="true
">
<!-- Load the OpenLaszlo site in a new window -->
<button
onclick
="lz.Browser.loadURL('http://www.openlaszlo.org/', '_blank')
">
Click me
</button
>
<script
>
// List the player version
Debug.debug('Player version: %w', lz.Browser.getVersion());
</script
>
</canvas
>
Name (CSS property) | Type (tag) | Type (js) | Default | Category |
---|---|---|---|---|
LzBrowser
|
lz.BrowserService | readonly | ||
The browser service. Also available as the global
lz.Browser .
|
Methods
callJS() |
---|
Parameter Name | Type | Description |
---|---|---|
methodname | String | Browser javascript method to execute |
callback | Function | Optional callback function to receive the return value of the javascript call. |
args | Optional arguments to call the method with |
getAppID() |
---|
getInitArg() |
---|
Parameter Name | Type | Description |
---|---|---|
name | String | The name of the key whose value to return. If null, returns an Object containing all initialization arguments. @return: The value for a key that appears in the request string that loaded the the lzx app or an Object containing all values |
getLoadURL() |
---|
getLoadURLAsLzURL() |
---|
getLzOption() |
---|
Parameter Name | Type | Description |
---|---|---|
name | String | The name of the key whose value to return. If null, returns an Object containing all initialization arguments. @return: The value for a key that appears in the lzoptions string |
getOS() |
---|
getURL() |
---|
getVersion() |
---|
isAAActive() |
---|
loadJS() |
---|
Parameter Name | Type | Description |
---|---|---|
js | String | Javascript string to execute |
target | String | Optionally specifies a named frame to display the contents of the URL. By default, the javascript specified in 'js' is executed in the current browser frame . |
loadURL() |
---|
Parameter Name | Type | Description |
---|---|---|
url | String | URL to load |
target | String | Optionally specifies a named frame to display the contents of the URL. Otherwise defaults to the current window. |
features | String | Optional features to use in the new window. |
makeProxiedURL() |
---|
setClipboard() |
---|
setWindowTitle() |
---|
showMenu() |
---|
urlEscape() |
---|
This method is deprecated | |
---|---|
Use encodeURIComponent(string) instead. |
urlUnescape() |
---|
This method is deprecated | |
---|---|
Use decodeURIComponent(string) instead. |
xmlEscape() |
---|
xmlUnescape() |
---|
Copyright © 2002-2010 Laszlo Systems, Inc. All Rights Reserved. Unauthorized use, duplication or distribution is strictly prohibited. This is the proprietary information of Laszlo Systems, Inc. Use is subject to license terms.