Platforms to show: All Mac Windows Linux Cross-Platform

WebScriptObjectMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 13.1 Yes No No Yes, macOS only No
Function: The private constructor.

Feedback, Comments & Corrections

WebScriptObjectMBS.evaluateWebScript(script as String) as Variant
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 7.5 Yes No No Yes, macOS only No
Function: Evaluates a script.
Example:
dim code as string

// code="1+5"
code="""hello ""+5"

dim d as DOMDocumentMBS = HTMLViewer1.mainFrameMBS.DOMDocument
MsgBox d.evaluateWebScript(code)
// shows result of calculations
Notes:
The script will be executed in the target script environment. The format of the script is dependent of the target script environment.

Name: The script to execute in the target script environment.

Feedback, Comments & Corrections

WebScriptObjectMBS.getValue(name as String) as Variant
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 7.5 Yes No No Yes, macOS only No
Function: Gets a value in this webscript object.
Example:
dim w as WebFrameMBS = HTMLViewer1.mainFrameMBS
dim d as DOMDocumentMBS = w.DOMDocument

MsgBox d.getValue("key")
Notes: Works for numbers, booleans, dates and strings.

Feedback, Comments & Corrections

WebScriptObjectMBS.removeValue(name as String)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 7.5 Yes No No Yes, macOS only No
Function: Removes a value with the given name.

Feedback, Comments & Corrections

WebScriptObjectMBS.setValue(name as String, value as Variant)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 7.5 Yes No No Yes, macOS only No
Function: Sets a value in this webscript object.
Example:
dim w as WebFrameMBS = HTMLViewer1.mainFrameMBS
dim d as DOMDocumentMBS = w.DOMDocument

d.setValue("key","Hello")
Notes: Works for numbers, booleans, dates and strings.

Feedback, Comments & Corrections

WebScriptObjectMBS.setWebScriptCallback(name as String, value as WebScriptCallbackMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 7.5 Yes No No Yes, macOS only No
Function: Sets a value in this webscript object.
Example:
// in the windowScriptObjectAvailable event you can register the callback object

Function windowScriptObjectAvailable(windowScriptObject as WebScriptObjectMBS) As boolean
// Install an Object called "MyBrowser" on the javascript document object
// Any function call inside will tricker callback event
dim callback as WebScriptCallbackMBS // your global callback object
windowScriptObject.setWebScriptCallback "MyBrowser", callback

End Function
Notes: This is the special version of SetValue to be used with the WebScriptCallbackMBS class.

Feedback, Comments & Corrections

WebScriptObjectMBS.setWebScriptValueAtIndex(index as Integer, value as Variant)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 7.5 Yes No No Yes, macOS only No
Function: Sets the value of the property at the specified index.
Notes:
Index is zero based.
Works for numbers, booleans, dates and strings.

Feedback, Comments & Corrections

WebScriptObjectMBS.stringRepresentation as String
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 7.4 Yes No No Yes, macOS only No
Function: The string representation of this object.
Notes: Returns an empty string on any error.

Feedback, Comments & Corrections

WebScriptObjectMBS.webScriptValueAtIndex(index as Integer) as Variant
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 7.5 Yes No No Yes, macOS only No
Function: Gets the value of the property at the specified index.
Example:
dim d as DOMDocumentMBS = HTMLViewer1.mainFrameMBS.DOMDocument
MsgBox d.webScriptValueAtIndex(1)
Notes:
Index is zero based.
Works for numbers, booleans, dates and strings.

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS MacControls Plugin.

The biggest plugin in space...




Links
MBS Xojo blog