Hi
In html I have
</div>
<script>
dlg_logon.passMapear;
</script>
in main.kt
@JsName("passMapear")
fun passMapear() {
ControllerLogon().passMapear()
}
the browser displays the following error: dlg_logon is not defined
my Git test
https://github.com/zuza07/kotlinJS
b
Big Chungus
04/08/2021, 5:33 PM
Looks like a race condition of script loading order
e
Eduardo Zuza
04/08/2021, 6:09 PM
I've tried this and it didn't work.
So I generated an index.html I placed a div and this div is loaded with the Password.html file, to reference your objects in the kotlin I call dlg_logon from within Password.html.
Eduardo Zuza
04/08/2021, 10:52 PM
even so it will not
<body>
<div id="wrapper">
<form onsubmit="return false">
<div class="form-group fixed-top" id="htmlDivCabec"></div>
<div role="main" class="container dlg-pad-top-15">
<div class="form-group dlg-pad-top-60" id="divEspacamento"></div>
<div class="form-group" id="htmlDiv1"></div>
<div class="form-group" id="htmlDiv2"></div>
</div>
</form>
</div>
<script src="dlg_logon.js"></script>
<script src="dlgw_araiz.js"></script>
<script>dlg_logon.passMapear();</script>