Top | ![]() |
![]() |
![]() |
![]() |
JSValueRef | gebr_js_eval_with_url () |
JSValueRef | gebr_js_evaluate () |
JSValueRef | gebr_js_evaluate_file () |
gchar * | gebr_js_value_to_string () |
GString * | gebr_js_value_get_string () |
gboolean | gebr_js_value_get_boolean () |
JSObjectRef | gebr_js_make_function () |
gboolean | gebr_js_include () |
JSValueRef gebr_js_eval_with_url (JSContextRef ctx
,const gchar *script
,const gchar *url
);
Evaluates script
at the given url
.
ctx |
A JSContextRef, from a WebKitWebView for example. |
|
script |
The JavaScript script to be evaluated. |
|
url |
The address associated with this script evaluation. |
JSValueRef gebr_js_evaluate (JSContextRef ctx
,const gchar *script
);
Evaluates the JavaScript given by script
.
ctx |
A JSContextRef, from a WebKitWebView for example. |
|
script |
The JavaScript script to be evaluated. |
JSValueRef gebr_js_evaluate_file (JSContextRef ctx
,const gchar *file
);
Evaluates the JavaScript file given by file
.
ctx |
A JSContextRef, from a WebKitWebView for example. |
|
file |
A system file path, pointing to the JavaScript file. |
gchar * gebr_js_value_to_string (JSContextRef ctx
,JSValueRef value
);
This function returns the string representation of value
. It is the same as calling the 'toString' method in
JavaScript.
Applying this function into a JSValueRef that is a JavaScript String will return the string itself. But
you should not trust this behavior. Use gebr_js_value_get_string()
for this purpose instead.
ctx |
A JSContextRef, from a WebKitWebView for example. |
|
value |
The value to get the string representation. |
GString * gebr_js_value_get_string (JSContextRef ctx
,JSValueRef val
);
Gets the string value of val
and returns it as a GString.
ctx |
A JSContextRef, from a WebKitWebView for example. |
|
val |
The value to get the string value. |
gboolean gebr_js_value_get_boolean (JSContextRef ctx
,JSValueRef val
);
Gets the boolean value from the JSValueRef, val
.
ctx |
A JSContextRef, from a WebKitWebView for example. |
|
val |
The JavaScript value to get the boolean value. |
JSObjectRef gebr_js_make_function (JSContextRef ctx
,const gchar *name
,JSObjectCallAsFunctionCallback callback
);
Creates a JavaScript function in context ctx
which calls callback
.
gboolean gebr_js_include (JSContextRef ctx
,const gchar *file
);
Includes a JavaScript file into a context by appending a lt
;scriptgt
; tag into
document.body. You must guarantee body tag exists, otherwise this function may fail silently.
This might be done by connecting to "load-finished" signal of WebKitWebView.