[][src]Function ul_sys::ulViewEvaluateScript

pub unsafe extern "C" fn ulViewEvaluateScript(
    view: ULView,
    js_string: ULString,
    exception: *mut ULString
) -> ULString

Evaluate a string of JavaScript and return result.

@param js_string The string of JavaScript to evaluate.

@param exception The address of a ULString to store a description of the last exception. Pass NULL to ignore this. Don't destroy the exception string returned, it's owned by the View.

@note Don't destroy the returned string, it's owned by the View. This value is reset with every call-- if you want to retain it you should copy the result to a new string via ulCreateStringFromCopy().

@note An example of using this API:

ULString script = ulCreateString("1 + 1");
ULString exception;
ULString result = ulViewEvaluateScript(view, script, &exception);
/* Use the result ("2") and exception description (if any) here. */
ulDestroyString(script);