GetJSEval Method (.NET)

 

Syntax:

object val =  extBrow.GetJSEval(string name);

name: the name of the property you assigned when calling the ExtendedOptions SetJSEval method.

 

Returns:

val: The result of the JavaScript execution for the code blocked named by name..

 

The GetJSEval method enables you to access the results of your own custom JavaScript code as executed on the visitor's browser.  This enable you to interface BrowserHawk with any external browser tests you wish to write, or with any other arbitrary data desired.

 

Tip: See the ExtendedOptions SetJSEval method for more details about interfacing BrowserHawk with external data.

 

Tip: You can log the results of your custom JavaScript execution to the BRWS database simply by passing the data in as one of the custom fields provided by the LogOptions class.

 

Note: This method requires the Enterprise Edition of BrowserHawk.

 

C# Example:

<%

ExtendedOptions options = new ExtendedOptions();

options.SetJSEval("localtime", "new Date().toString()");

ExtendedBrowserObj extBrow = BrowserObj.GetExtendedBrowser(options);

string browserTime = (string) extBrow.GetJSEval("localtime");

%>

<html>

Your local time is: <% = browserTime %>

</html>

 

Tip: See the ret-eval.aspx sample distributed with BrowserHawk for an alternate example of how to execute custom JavaScript to obtain custom results which are then enforced by BrowserHawk's Rules Enforcement Technology (RET).

 

See Also:

SetJSEval Method (.NET)

GetJSEvalNames Method (.NET)

Plugin_Custom Property (.NET)