Replies: 4 comments 2 replies
-
export function __wbg_href_0286eba8d0d35cc2() { return logError(function () { |
Beta Was this translation helpful? Give feedback.
-
I don't think |
Beta Was this translation helpful? Give feedback.
-
getter not working |
Beta Was this translation helpful? Give feedback.
-
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen]
pub type WindowLocation;
#[wasm_bindgen]
pub type Window;
#[wasm_bindgen(js_name = "window")]
pub static WINDOW: Window;
#[wasm_bindgen(method, getter, js_name = "location")]
pub fn get_location(this: &Window) -> WindowLocation;
#[wasm_bindgen(method, getter, js_name = "href")]
pub fn get_href(this: &WindowLocation) -> JsValue;
}
#[wasm_bindgen]
pub fn retrieve_href() -> JsValue {
WINDOW.get_location().get_href()
} By the way, #[wasm_bindgen]
extern "C" {
# [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = Window , typescript_type = "Window")]
#[derive(Debug, Clone, PartialEq, Eq)]
pub type Window;
} |
Beta Was this translation helpful? Give feedback.
-
Seek help.
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(js_namespace = ["window", "location"])]
#[wasm_bindgen(js_name = "href")]
fn window_location_href() -> JsValue;
}
#[wasm_bindgen]
pub fn get_window_location_href() -> String {
let href_value = window_location_href();
}
window.location.href is no function
Beta Was this translation helpful? Give feedback.
All reactions