Skip to main content
Version: Next

WA SET PAGE CONTENT

WA SET PAGE CONTENT ( {* ;} object ; content ; baseURL )

ParameterTypeDescription
*OperatorIf specified, object is an object name (string) If omitted, object is a variable
objectanyObject name (if * is specified) or Variable (if * is omitted)
contentTextHTML source code
baseURLTextURL for relative references (Mac OS)

This command is not thread-safe, it cannot be used in preemptive code.

Compatibility Note

This historical command is no longer really useful. As security is tightened in modern browsers, there are more and more restrictions on modifying page content "on the fly". A more reliable approach is to create a local file (e.g. in the temporary folder) and use WA OPEN URL to load it. To clear the content, just call WA OPEN URL(myArea;”about:blank”).

Description

The WA SET PAGE CONTENT command replaces the page displayed in the Web area designated by the * and object parameters by the HTML code passed in the content parameter.

The baseURL parameter specifies, under Mac OS, a base URL that will be added in front of any relative links found in the page.

Under Windows, this parameter has no effect and the base URL is not specified so it is not possible to use relative references on this platform.

Note: Under Windows, you cannot call this command unless a page has already been loaded previously into the Web area. If necessary, you can pass the "about:blank" URL in order to load a blank page.

Example

Displays "Hello world!" and sets a "file:///" base URL (Mac OS only):

 WA SET PAGE CONTENT(MyWArea;"

[Hello World!]

";"file:///")

See also

WA Get page content