Yuav Ua Cas Thiaj Java Tsab Ntawv

Cov txheej txheem:

Yuav Ua Cas Thiaj Java Tsab Ntawv
Yuav Ua Cas Thiaj Java Tsab Ntawv

Video: Yuav Ua Cas Thiaj Java Tsab Ntawv

Video: Yuav Ua Cas Thiaj Java Tsab Ntawv
Video: YUAV COJ LI CAS TU NEEG KOJ HLUB THIAJ NCO KOJ 2024, Hlis ntuj nqeg
Anonim

Lub vev xaib niaj hnub no yog qhov nyuaj rau xav txog yam tsis muaj sau ntawv. Ua tsaug rau cov lus scripting, nws tau dhau los ua ntau txoj haujlwm hauv browser, los ntawm kev tsim qauv tsos ntawm nplooj ntawv los tshawb xyuas cov ntaub ntawv nkag los ntawm tus neeg siv khoom. Xws li nrog rau lwm hom lus, koj yuav tsum pib kawm java-scriрt nrog cov lus piv txwv.

Yuav ua cas thiaj java tsab ntawv
Yuav ua cas thiaj java tsab ntawv

Cov Lus Qhia

Kauj ruam 1

Koj yuav tsum nco ntsoov tias java-ntawv tsis yog ib feem ntawm HTML, nws yog hom lus ntawm nws tus kheej. Tab sis nws tau teeb tsa rau ntawm nplooj ntawv kab ntawv lossis txuas rau tsab ntawv sau yog muab rau nws. Txhawm rau kom kawm paub yuav ua li cas sau Java scripts, koj xav tau tus HTML editor nrog syntax highlighting. Piv txwv, CuteHTML yog ib tus kws kho sau ntawv me thiab nyiam siv ntau.

Kauj ruam 2

Raws li txoj cai, kev kawm hom lus pib nrog saib cov kab lus tam sim no "Nyob zoo, ntiaj teb!" Txhawm rau muab cov kab no tso rau ntawm lub browser screen, qhib cov editor thiab sau cov lej hauv qab tom qab lub cim BODY: Cov kab no qhia lub browser tias JavaScript pib txij ntawm no.

Kauj ruam 3

Ntaus kab thib ob: document.write ("Nyob zoo, ntiaj teb!") Cov kab no yuav tso cov kab lus "Nyob zoo, ntiaj teb!" Hauv lub browser window. Ua tib zoo mloog cov ntsiab lus ntawm kab ntawv no: ua ntej, qhia txog kev paub yog tias cov ntawv yuav tshwm. Tom qab ntawd cov tsis dhau ntawm cov ntawv sau tshwj tseg - hauv qhov no, nws cov xim. Lwm yam kev txiav txim yuav tau ntxiv, xws li qhov loj me thiab hom.

Kauj ruam 4

Xaus nrog java-tsab ntawv tag: Daim cim npe no taw qhia qhov browser tias tsab ntawv tiav lawm. Tam sim no koj tau nkag mus rau txhua kab hauv editor, nyem qhov View hauv browser khawm hauv cov editor (daim iav tsom iav nyob rau tom qab ntawm lub ntiaj teb). Nyob rau hauv lub neej ntawd browser pib uas qhib, koj yuav pom qhov tshwm sim ntawm koj thawj tsab ntawv. Thov nco ntsoov tias lub browser tuaj yeem thaiv nws txoj kev ua tiav, thiab cov lus ceeb toom coj yuav tshwm sim. Cia tus browser khiav java scripts.

Kauj ruam 5

Koj tuaj yeem hloov qhov loj me ntawm cov ntawv sau los ntawm ntxig tom qab xim 'LIAB', cais los ntawm qhov chaw, qhov loj = 7. Kev sim nrog qhov loj me los ntawm kev hloov pauv cov lej. Hloov cov xim dhau - piv txwv, kom 'XIAV'.

Kauj Ruam 6

Muaj tseeb koj tau pom cov lus ceeb toom tshwm nyob rau nplooj ntawv ntau dua ib zaug. Koj tuaj yeem tso cov lus zoo li no nrog java-ntawv. Ntaus cov code hauv qab no rau hauv cov editor. Nws yog qhov yooj yim heev, yog li koj tuaj yeem nkag siab nws yooj yim. Kom paub cov ncauj lus kom ntxaws ntawm java-tsab ntawv, tshawb hauv Is Taws Nem txog kev qhia muaj feem xyuam.

Pom zoo: