Remote JS¶
Handles javascript remote function calls
-
rpcjs.binding.append_child(id, node)[source]¶ Set the attribute of an element on the webpage
Parameters: - id: str
id of the DOM element
- node: str
child node
-
rpcjs.binding.bind(id, event, handler, attribute=None, property=None)[source]¶ Bind an element event to a handler and return a property of an attribute of the element
Parameters: - id: str
id of the DOM element
- event: str
Name of the event we are listening too. The full list of supported events can be found here.
- handler: call
function to callback when the event is fired
- attribute: str
Attribute of the element to return
- property: str
Property of the element to return
-
rpcjs.binding.get_element_size(id, callback)[source]¶ Get the size of an element inside the webpage
Parameters: - id: str
id of the DOM element
- callback: Call
Function to call with the size information {width: w, height: h}
-
rpcjs.binding.redirect(url)[source]¶ Set the attribute of an element on the webpage
Parameters: - url: str
url to redirect the client to
-
rpcjs.binding.register_event(event, handler, namespace='/')[source]¶ Register a socketio event to a python handler
Parameters: - event: str
Name of the event
- handler: call
Function to call when the event is fired
-
rpcjs.binding.set_attribute(id, attribute, value)[source]¶ Set the attribute of an element on the webpage
Parameters: - id: str
id of the DOM element
- attribute: str
name of the attribute to set
- value: json
new value of the attribute