ZennoLab Assemblies Documentation
EvaluateScript Method
Example 
ZennoLab.CommandCenter Namespace > Document Class : EvaluateScript Method

Type: System.String

A string expression with javascript.

Type: System.Boolean

true if have to throw the JavaScript Evaluate exception; otherwise, false. The default value is false.

Type: System.Boolean

true if use alternative method of execution JavaScript code; otherwise, false. The default value is false.

Executes a java script that is implemented by the currently loaded document.
Executes a java script that is implemented by the currently loaded document.
Syntax
public string EvaluateScript( 
   string script,
   bool throwException,
   bool altWay
)

Parameters

script

Type: System.String

A string expression with javascript.

throwException

Type: System.Boolean

true if have to throw the JavaScript Evaluate exception; otherwise, false. The default value is false.

altWay

Type: System.Boolean

true if use alternative method of execution JavaScript code; otherwise, false. The default value is false.

Return Value

Type: System.String

The result of the script execution.

Example
The following code example demonstrates uses of the EvaluateScript method.
public static int Execute(Instance instance)
{
    Tab tab = instance.MainTab;
    if ((tab.IsVoid) || (tab.IsNull)) return -1;
    if (tab.IsBusy) tab.WaitDownloading();
    return tab.MainDocument.EvaluateScript("document.write(1)");
}
public static function Execute($instance)
{
    $tab = $instance->MainTab;
    if (($tab->IsVoid) || ($tab->IsNull)) return -1;
    if ($tab.IsBusy) $tab->WaitDownloading();
    return $tab->MainDocument->EvaluateScript("document.write(1)");
}
Requirements

Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.

See Also

Reference

Document Class
Document Members