Yuav Ua Li Cas Kom Tshem Tawm Qhov Yuam Kev Ntawm Nplooj Ntawv

Cov txheej txheem:

Yuav Ua Li Cas Kom Tshem Tawm Qhov Yuam Kev Ntawm Nplooj Ntawv
Yuav Ua Li Cas Kom Tshem Tawm Qhov Yuam Kev Ntawm Nplooj Ntawv

Video: Yuav Ua Li Cas Kom Tshem Tawm Qhov Yuam Kev Ntawm Nplooj Ntawv

Video: Yuav Ua Li Cas Kom Tshem Tawm Qhov Yuam Kev Ntawm Nplooj Ntawv
Video: Nas Ej Maiv Thoj Yuav Txiv Lawm Tiag Tiag 20/8/2021 2024, Hlis ntuj nqeg
Anonim

Feem ntau heev cov programmers sau cov lej ntawm nplooj ntawv nplooj ntawv tsis nco qab xyuas dab tsi rau hauv Internet browser (Internet Explorer, Mozilla, Opera, thiab lwm yam) thiab version yuav raug siv los saib lub xaib. Rau kev ua tsis raug ntawm cov ntawv ntawm nplooj ntawv hauv txhua browsers, nws yog qhov yuav tsum tau kho cov ntu ntawm nplooj ntawv qhov twg cov khoom lossis cov hau kev tshwj xeeb rau qhov no lossis siv Internet browser. Kev tsis saib xyuas lossis tsis lees paub txog cov ntsiab lus no tuaj yeem ua rau qhov tseeb tias nyob hauv qab ntawm lub browser qhov rai, ntawm sab laug ntawm cov xwm txheej bar, ib lub icon tshwm - daim duab peb sab nrog cov cim exclamation, thiab nplooj ntawv tau saib yog tso tawm thiab tsis ua haujlwm Ob peb cov lus qhia yooj yim yuav tso cai rau cov tsim tawm kom zam dhau qhov kev tsis raug ntawd.

Daim duab 1. Browser lub thawv piav qhia txog qhov yuam kev
Daim duab 1. Browser lub thawv piav qhia txog qhov yuam kev

Tsim nyog

Cov kev txawj ntawm kev ua haujlwm nrog html thiab JavaScript lus

Cov Lus Qhia

Kauj ruam 1

Ua ntej tshaj plaws, koj yuav tsum tsim qhov teeb meem thiab qhov chaw ntawm kev ua yuam kev. Txhawm rau ua li no, nyem rau ntawm lub cim thiab hauv cov ntawv sib tham uas tshwm sim, nyem "Qhia kom paub meej" khawm. Tom qab ntawd, koj tuaj yeem saib cov kab ntawv yuam kev thiab kab xov tooj ntawm nplooj ntawv kab ntawv uas muaj cov lus qhia tsis tseeb - Daim duab 1. Raws li txoj cai, cov no yog JavaScript yuam kev, thiab lawv tshwm sim los ntawm qhov tsis tseem ceeb cim tsis tau los yog qhov tseeb tias cov syntax thiab txhawb cov haujlwm thiab cov khoom ntawm cov lus no sib txawv hauv Internet browsers.

Kauj ruam 2

Tom qab txheeb xyuas cov ntawv sau ntawm qhov yuam kev, koj yuav tsum tau txiav txim siab seb qhov no puas yog qhov yuam kev cai los yog nws tshwm sim vim tias Internet browser koj siv lossis nws tam sim no tsis txhawb koj tus qauv JavaScript. Nws yooj yim to taub hom kev ua yuam kev twg - cia li qhib nplooj ntawv hauv browser sib txawv. Yog tias qhov yuam kev tshwm sim txhua qhov chaw, tom qab ntawd nws yog qhov txaus los kho qhov coding yuam kev. Feem ntau qhov yuam kev ntawm yam no yog syntax thiab xa mus rau cov khoom khoob lossis tsis muaj (tsis muaj) ntawm cov khoom lossis cov hau kev.

Kauj ruam 3

Nyob rau hauv rooj plaub thaum qhov yuam kev tsis tshwm sim hauv txhua tus browser hauv Internet, nws yog qhov yuav tsum tau yooj yim los ntawm txoj cai los ntawm tsis lees txais kev siv cov haujlwm tshwj xeeb lossis cov khoom uas tsuas yog tshwj xeeb rau JavaScript ntawm qhov browser uas nplooj ntawv tshwm tsis muaj kev ua yuam kev, lossis ntxiv rau daim tshev rau hom Internet browser thiab nws cov version thiab nyob ntawm qhov txiaj ntsig, hu rau cov hau kev tsim nyog lossis khoom siv, lossis tseem siv tshwj xeeb syntax.

Ntawm no yog qhov JavaScript snippet uas muaj qhov piv txwv ntawm qhov kev ntsuas qhov yooj yim rau hom thiab version ntawm qhov browser browser:

yog tias (Thov. Browser. Browser == "IE" && Thov kom. Browser. Version == "6.0")

{

rn_img. Style. Add ("keeb kwm yav dhau", "url (images / blank.gif)");

}

lwm tus

{

…..

}.

Pom zoo: