[][src]Function web_view::escape

pub fn escape(string: &str) -> Escaper

Escape a string to pass it into JavaScript.

Example

let string = "Hello, world!";

// Calls the function callback with "Hello, world!" as its parameter.

view.eval(&format!("callback({});", web_view::escape(string)));