jweb

Website data in a Max UI external

Description

The jweb object uses OS-specific technologies (WebKit on the Macintosh, WebBrowser ActiveX Control on Windows systems) to view renderable data in a Max box.

Arguments

None.

Messages

(drag) When a file is dragged from the Max 5 File Browser to a jweb object, the file will be loaded.
back The word back reloads the previous page of data, functioning like the 'Back' button in a conventional web browser.
forward When a sequence of multiple pages has been loaded, and the object has received the back message, the word forward will advance to the following page in the object's page history. forward functions like the 'Forward' button in a conventional web browser.
gethistory The word gethistory, will output a list of all URLs loaded by the object since its instantiation, in the reverse order of access, with additional information. The output format is: history URL (symbol) page title (symbol) number of page loads (int) time stamp of last load (int) . After the last history entry is output, the message history done will be sent from the outlet.
read url [symbol]
The word read, followed by a symbol that specifies a URL or a file pathname, will read the webpage or file and attempt to render its contents. Upon successful load of a page, two messages are sent from the object's outlet: url, followed the final URL which was loaded based on the provided argument; and title, followed by the title of the loaded page as a symbol.
readfile file path [symbol]
The word readfile, followed by a symbol that specifies a file pathname, will read the file and attempt to render its contents. The word readfile with no argument opens a file dialog to choose a file. Upon successful load of a page, two messages are sent from the object's outlet: url, followed the final URL which was loaded based on the provided argument; and title, followed by the title of the loaded page as a symbol.
reload The word reload causes the browser to refresh the current page, functioning like the 'Reload' button in a conventional web browser.
writehistory file name [symbol]
The word writehistory, followed by a symbol the specifies the name of a file, will write a history of the object's use since its instantiation as an xml-format file. The word writehistory with no arguments opens a file dialog to choose a file.

Attributes

Name Type g/s Description
autosize int
def.:0
Caches the right and bottom margins of the jweb object, using them to resize the object's box as the containing view is resized.
res_report int
def.:0
Toggles the printing of data about resources loaded when referencing a webpage or file. The listing of resources takes the form:
total_resources loaded_resources failed_resources .
scrollbars int
def.:0
Enables the display of horizontal/vertical scrollbars, as required by the size of the webpage in comparison with the jweb object's window. Note the scrollbars can only be enabled or disabled previous to the loading of a new webpage/file.
url symbol
def.:
Displays the current URL being displayed.

Information for box attributes common to all objects

Examples

See Also

Name Description
js Execute Javascript
Max JS Tutorial 1: Basic JavaScript Max JS Tutorial 1: Basic JavaScript
Max JS Tutorial 2: JavaScript Scripting Max JS Tutorial 2: JavaScript Scripting
Max JS Tutorial 3: JavaScript Tasks, Arguments, and Globals Max JS Tutorial 3: JavaScript Tasks, Arguments, and Globals