Hi guys I am an android developer and quite new to...
# javascript
s
Hi guys I am an android developer and quite new to KMP and kobweb. I was recently experimenting with kobweb. I wonder if it is possible to use js function from kotlin. where to place the js file in the sourceset and call that in kotlin. This is what I tried. But when I tried to show the webpage in android webview, I get the error that
"Uncaught ReferenceError: globalThis is not defined"
Copy code
fun invokeClick() {
    js(" MessageInvoker.postMessage('clicked')")
}

Button(
                    attrs = Modifier.onClick {
                        if (cta == "Cashbook") invokeClick()
                    }.fillMaxWidth().height(ButtonHeight)
                        .border(NilBorder).borderRadius(BorderRadius)
                        .color(Colors.Navy.copy(alpha = 250))
                        .boxShadow(blurRadius = BlurRadius, spreadRadius = SmallSpreadRadius, color = Colors.Black.copy(alpha = 30))
                        .backgroundColor(Colors.SkyBlue.copy(alpha = 190))
                        .fontWeight(FontWeight.Bolder)
                        .fontFamily("Arial").toAttrs()
                ) {
                    Text("Check it out".uppercase())
                }
e
Probably #C04RTD72RQ8 is better for this
👍 1