Hi All
I was trying to play around with kotlin as a JS frontend. I created a small html page which loads:
resources/js/kotlinEcma3.js
resources/js/js-engine.js
the second being the output of my kotlin program:
fun main(args: Array<String>) { jq { val title = jq("html head title") title.text("test") jq("div#uri").text(window.document.baseURI) var iep = -1 for(ci in 0..window.document.baseURI.length() ) { val c = window.document.baseURI[ci] if(c == '/') iep = ci; } jq("div#base").text("${iep}") val base = window.document.baseURI.substring(0, iep)
jq("div#base").text("${iep} " + base)
}
}
the jq part works fine, but trying to use lastIndexOf or iterating fails, because length() or lastIndexOf() are not found. Do I need to import some additional js code?
Kind Regards
Sasa
P.S.: i am really impressed by kotlin. kudos jetbrains