response, resolve, reject, unbindJs
// Simple callback without params void hello() { ... } // Js arguments will be passed as JSON array void world(JSONValue[] args) { ... } // You can use the sequence arg to return a response. void reply(JSONValue[] args, string sequence) { ... resolve(sequence, JSONValue("Hello Js!")); } webview.bind!hello; // If you call hello() from js, hello() from D will respond webview.bind!hello("test") // If tou call test() from js, hello() from D will respond
Create a callback in D for a js function.