Pro Android with Kotlin


CHAPTER 10: Development


Download 5.42 Mb.
Pdf ko'rish
bet223/223
Sana04.11.2023
Hajmi5.42 Mb.
#1746807
1   ...   215   216   217   218   219   220   221   222   223
Bog'liq
@de android telegram Pro Android with Kotlin Developing Modern Mobile



283
CHAPTER 10: Development
Create the file Main.kt inside src/main/kotlinjs and add content to it as follows:
import kotlin.browser.document
fun main(args: Array) {
val message = "Hello JavaScript!"
document.getElementById("cont")!!.innerHTML = message
}
In the end we will be targeting a web site, so we need a first HTML page as well. Make it the 
standard landing page index.html, create it inside src/main/web, and enter the following:



Kotlin-JavaScript





Download 5.42 Mb.

Do'stlaringiz bilan baham:
1   ...   215   216   217   218   219   220   221   222   223




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling