JavaScript kuyinto isetshenziswe yonke indawo online kulezi zinsuku – ukwenza ngcono ukuxhumana kwewebhusayithi, ukuqinisekisa imininingwane, kanye / noma ukuthuthukisa ukuphuma kwewebhusayithi.IJavaScript ir labs okokuqala kwi-1995 futhi ifike kude kusukela lapho ngokwemigomo yokwamukelwa nokuthi isetshenziswa kanjani. I-sintakse esetshenziswe kuJavaScript yathonywa ngokuqinile yi-C; kodwa iJava, Pearl, Python, ne-Scheme nayo nayo yadlala indima yayo.Izeluleko Zokuqala zeJavaScript: Okudingayo Ukuze Ukwazi?Okokuqala, izinto eziyisisekelo ezimbalwa okudingeka wazi:I-JavaScript ir pieejams visurI-JavaScript izosebenza njalo lapho ikhasi lilayishwaI-JavaScript tas ir personhathi ukulayisha ngokuxhumeka kwe-IntanethiI-JavaScript isasuka kumakhasi e-cachedUngabamba i-JavaScript ngaphakathi kwekhasi lewebhu noma ngaphandle kwefayela le-.jsI-Javascript ihluke ngokuphelele kuneJavaKubalulekile futhi ukuqonda ukuthi iJavaScript empeleni izokuholela enhlekeleleni uma isetshenziswa ngendlela activfanele.Amakheli we-JavaScript akhiwe kahle futhi anobuhlakani azonciphisa iwebhusayithi yakho futhi alimaze ukuzulazula jikelele kwesayithi. Lokhu nakho kuthinta inani lokubuya kwezivakashi zakho (ngenxa yolwazi lomsebenzisi olubi) kanye namazinga ezinjini zokusesha (ngenxa yamanani wokuphendula wewebhusayithi aphambili kanye nokukhasa kwe-bot). Ukusiza ukuqinisekisa icala lami lapha, zifake ezicathulweni zokubuka. Uma iwebhusayithi oyivakashele ilayishe kancane, bekunzima ukuyisebenzisa, futhi, ukungavezi – ngabe ubuyela kusayithi? Ngeke.Ngezansi kunohlu oluncane lwezinto okufanele ucabange ngazo lapho ungeza iJavaScript kuyo iwebhusayithi yakho.Ingabe i-JavaScript idinga ukuthi isayithi isebenze kahle?Isayithi lizobonakala kanjani uma i-JavaScript ivinjelwe?I-JavaScript izolimaza ukusebenza kweseva?Ingabe uzongeza ukusiza kwe-JavaScript ukuhambisa isayithi lakho ngendlela ofuna ukuyifaka ngayo?Ča, angizami ukukusabisa ngala maphuzu.Eqinisweni, ungesabi Sebenzisa iJavaScript kuwebhusayithi yakho njengoba ihlinzeka ngezinzuzo zamathani futhi, njengoba kushiwo, isetshenziswa ezinkulu. Iphuzu eliyisihluthulelo engizama ukulifinyelela lapha akuyona nje ukuqhubeka unezela izici zeJavaScript kusayithi lapho kungenasidingo khona. Amanye amasayithi azodinga iJavaScript enkulu kunamanye; ezinye zidinga okuncane nje – Ukuthi isayithi eyodwa iyayenza akusho ukuthi nawe kufanele wenze okufanayo.1 I-Freebies: I-15 Jauns I-JavaScript Imiklamo Yewebhusayithi Yakho1.1 I-1. Ukuqonda ividiyo ye-HTML51.2 I-2. Amakhuki weJavaScript1.3 I-3. Layisha kuqala izithombe zakho1.4 I-4. Ukuqinisekiswa kwe-imeyili1.5 I-5. Akukho Qhafaza kwesokudla1.6 I-6. Khombisa Izingcaphuno ezingekho emthethweni1.7 I-7. Izixhumanisi Zangaphambilini / Ezilandelayo1.8 I-8. Beka i-grāmatzīmju ekhasini1.9 I-9. Isixhumanisi Esilula Sekhasi Lephepha1.10 I-10. Khombisa usuku oluhleliwe1.11 I-11. Isihlukanisi seComma1.12 I-12. Thola Indawo Yokubonisa Yesiphequluli1.13 I-13. Phinda uqondise kabusha ngokubambezeleka kokukhetha1.14 I-14. Tola ama-iPhones1.15 I-15. Phrinta Umlayezo ku-Isimo BarI-Freebies: I-15 Jauns I-JavaScript Imiklamo Yewebhusayithi YakhoManje, ake sehle kulokho okufike lapha – ngezansi uhlu lwama-snippets e-15 JavaScript azothuthukisa isayithi lakho ngokusebenza noma ukubukeka. Ikhodi izophulwa ibe yizingxenye ezimbili, ikhanda nomzimba noma ifayela le- .js. Uma kunganikezwa isihloko sesigaba ngakho-ke asidingeki kuleso slathi esithile.I-1. Ukuqonda ividiyo ye-HTML5Isampula esheshayoumsebenzi uyaqonda_video () {Atgriezties !! document.createElement (‘video’). canPlayType; // Būla} uma (! ukuqonda_video ()) {// Kufanele kube yisipheqululisidala noma i-IE. // Mhlawumbe jena efana nokufihla izilawuli // HTML5 Izilawuli. Noma yini … videoControls.style.display = ‘nav’; }Jenzani i-JavaScript fragments?Le fragments encane izokuvimbela iwebhusayithi yakho ukuthi izame ukubonisa ividiyo isiphequluli esinakukwazi ukusekela, ukulondoloza amandla omgwaqo kanye nokucubungula amandla.I-2. Amakhuki weJavaScript/ ** * Imisa ikhukhi ngegama elinikeziwe nenani. * * Igama Igama le-cookie * Inani le-cookie * [liphelelwa yisikhathi] Isikhathi sokuphelelwa kukhukhi (okuzenzakalelayo: ukuphela kweseshini yamanje) * [indlela] Indlela lapho ikhukhi isebenza khona] Ohazenzalele ((šajāzakalelayo: isizinda sedokhumenti yokushayela) * [evikelekile] Inani le-Boolean elibonisa uma ngabe ukuhanjiswa kukhukhi kudinga ukuhanjiswa okuphephile * / ukusebenza setCookie (igama, inani, ukuphelelewa isikuaki) + "=" + ukuphunyuka (inani) + ((kuphelelwa isikhathi)? "; kuphelelwa isikhathi =" + derīguma termiņš.toGMTSstring (): "") + ((indlela)? "; indlela =" + indlela: "") + ((isizinda)? "; domēns =" + domēns: "") + ((kuvikelekile)? "; kuvikelekile": ""); } / ** * Ithola inani le-cookie echaziwe. * * Igama Igama le-cookie oyifunayo. * * Ibuyisa intambo equkethe inani lekhukhi echaziwe, * noma i-null uma ikhukhi lingekho. * / funkcija GetCookie (igama) {var dc = document.cookie; var prefikss = igama + "="; var qala = dc.indexOf (";" + isiqalo); uma (qala == -1) {qala = dc.indexOf (isiqalo); uma (qala! = 0) buyela null; } okunye {qala + = 2; } var end = document.cookie.indexOf (";", qala); uma (ukuphela == -1) {beigas = dc.length; } pirkt ubuwena (dc.substring (qala + prefikss.garums, beigas)); } / ** * Unamathisela ikhukhi elibekiwe. * * Igama legama le-cookie * [indlela] yendlela yekhukhi (kumele ifane nendlela esetshenziselwa ukudala ikhukhi) * sīkfaila domēns (kumele ilingane nesizinda esisetshenziselwe ukudala ikhukhi) * / funkcija DeleCookie (igama, (GetCookie (igama)) {document.cookie = igama + "=" + ((indlela)? "; ceļš =" + indlela: "") + ((domēns)? "; isizinda = "+ domēns:" ") +"; derīguma termiņš beidzas = Ceturtdien, 01.-Jan – 70 00: 00: 01 GMT "; }}Le fragments isikhashana kodwa iwusizo kakhulu, izovumela isayithi lakho ukuthi ligcine ulwazi kwikhompyutha yombukeli bese lifunda kwelinye iphuzu ngesikhathi. Le fragments ingasetshenziswa ngezindlela eziningi ezahlukene zokufeza imisebenzi ehlukile.I-3. Layisha kuqala izithombe zakhoizithombe ze-var = i-Array entsha (); i-preloadImages () {ye (i = 0; iLe fragments izovimbela isayithi lakho ukuthi lingabi nesikhathi esibucayi lapho ibonisa kuphela ingxenye yesayithi; Lokhu akukona nje kubukeka kubi kodwa futhi akusizi ngalutho. Konke okumele ukwenze wengeze izithombe zakho esigabeni sokulayisha kuqala futhi ulungele ukugoqa.I-4. Ukuqinisekiswa kwe-imeyiliInhloko:umsebenzi uqinisekisaEmail (theForm) {if (/ ^ w + audiotaurwa-> /.test(theForm.email-id.value)) {pirkt (iqiniso); isexwayiso ("Ikheli le-imeyili elingavumelekile! Sicela ufake futhi ngokucophelela !."); buyela (ngamanga); }umzimba: Ikheli le-imeyili:Īss fragments izokuqinisekisa ukuthi ikheli le-imeyili elifomethwe kahle lifakwe kwifomu, alinakuqinisekisa ukuthi ikheli le-imeyili langempela, akukho ndlela yokukuhlola lokho ngeJavacript.I-5. Akukho Qhafaza kwesokudlaumsebenzi f1 () {uma (amaphepha.all) {buyela amanga; }} sebenza f2 (e) {if (document.layers ||) (document.getElementById &! document.all)) {if (e.which == 2 || e.which == 3) {buyela amanga; }}} uma (document.layers) {imibhalo.captureEvents (Umcimbi.MOUSEDOWN); idokhumenti.onmousedown = f1; } okunye {document.onmouseup = f2; umqulu.oncontextmenu = f1; } idokhumenti.oncontextmenu = umsebenzi omusha ("buyisa amanga");Le fragments izovimbela umbukeli ukuba akwazi ukuchofoza ngakwesokudla ekhasini lakho. Lokhu kunganciphisa umsebenzisi ojwayelekile ukuboleka izithombe noma ikhodi kusuka kusayithi lakho.I-6. Khombisa Izingcaphuno ezingekho emthethweniGalva: bhalaRandomQuote = umsebenzi () {var citēt = masīvs entsha (); izingcaphuno [0] = "Isenzo yisilinganiso sangempela sobuhlakani."; izingcaphuno [1] = "Es beisbola inenzuzo enkulu phezu kwekhilikithi yokuthi isheshe iphele."; izingcaphuno [2] = "Yonke inhloso, yonke isenzo, yonke imicabango, nakho konke ukuzwa, ngabe kukaziwa noma kungaziwa, ngumzamo wokukhulisa izinga lokuthula kwengqondo."; izingcaphuno [3] = "Inhloko enhle nenhliziyo enhle zihlala ziyinhlanganisela ebabazekayo."; var rand = Math.floor (Math.random () * izingcaphuno.length); umqulu.write (izingcaphuno [zamarandi]); } bhalaRandomQuote ();umzimba: bhalaRandomQuote ();Kulungile lokhu akusiyo ishidi ukuthi zonke izingosi zingasebenzisa kodwa zingasetshenziswa ukubonisa okungaphezulu nje kokucaphuna okungahleliwe. Ungashintsha okuqukethwe ok izingcaphuno kunoma yini oyifunayo futhi ube nezithombe ezingahleliwe noma umbhalo oboniswe noma kuphi kusayithi lakho.I-7. Izixhumanisi Zangaphambilini / EzilandelayoIkhasi langaphambilini | Ikhasi elilandelayoLe snippet inkulu uma unamakhasi amaningi ku-athikili noma kusifundo. Izovumela umsebenzisi ukuthi upheqa phakathi kwamakhasi kalula. Kuyinto encane futhi isisindo esincane esivela endaweni yokubuka.I-8. Beka i-grāmatzīmju ekhasiniLe snippet izovumela umsebenzisi ukuthi azimise ikhasi lakho kalula; konke okumele bakwenze ukuchofoza isixhumanisi. Izici zayo ezincane ezifana nalokhu ezingandisa ababukeli bakho ulwazi jikelele.I-9. Isixhumanisi Esilula Sekhasi LephephaIkhasi LokuphrintaLesi sixhumanisi esincane sizovumela imibono yakho ukuba iphrinta kalula ikhasi lakho. Isebenzisa isici sokuphrinta esheshayo sesivele sisethiwe ngesiphequluli sakho futhi asisebenzisi izinsiza kuze kuchofozwe.I-10. Khombisa usuku oluhleliweGalva: parādīt showDate () {var d = usuku olusha (); var curr_date = d.getDate (); var curr_month = d.getMonth () + 1; // izinyanga nulles nulles curr_year = d.getFullYear (); umqulu.write (curr_date + "-" + curr_month + "-" + curr_year); }umzimba: showDate ();Le fragments izokuvumela ukuba ubonise usuku lwamanje noma kuphi ekhasini lakho lewebhu futhi akudingeki libuyekezwe. Mane nje uyibeke endaweni futhi ukhohlwe ngakho.I-11. Isihlukanisi seCommaGalva: i-funkcija addCommas (inombolo) {num + = ”; var n1 = inombolo.split (‘.’); var n2 = n1 [0]; var n3 = n1.length> 1? ‘.’ + n1 [1]: ”; var temp = / (d +) (d {3}) /; ngenkathi (temp.test (n2)) {n2 = n2.aizstāt (temp, ” + ‘,’ + ”); } var out = atgriešanās n2 + n3; umqulu.bhala (ngaphandle); }umzimba: i-addCommas ("4550989023");Le fragments ingasetshenziswa ikakhulukazi amasayithi asebenzisa izinombolo kaningi. Le fragments izogcina izinombolo zakho zibukeka ezifanayo ebhodini. Konke okumele ukwenze ukukopisha umugqa womzimba lapho ufuna ukwengeza khona inombolo bese ushintsha inombolo lapho ngenombolo yakho.I-12. Thola Indawo Yokubonisa YesiphequluliUbubanzi besikhathi sakho sokubuka ngu ‘+ skata joslas platums +’ x ‘+ skata lauka augstums +’Le fragments izokuvumela ukuthi uthole ububanzi nokuphakama kwendawo yokubonisa kusiphequluli sakho sokubukwa. Lokhu kuzonikeza umklami ikhono lokudala nokusebenzisa izibonisi ezahlukene ngokususelwa kusayizi wesiphequluli sesiphequluli somsebenzisi.I-13. Phinda uqondise kabusha ngokubambezeleka kokukhethasetTimeout ("windows.location.href = ‘http://walkerwines.com.au/’", 5 * 1000);Le fragments izokuvumela ukuba uqondise kabusha ababukeli bakho kwenye ikhasi futhi unendlela yokubeka ukulibaziseka. Ukusetshenziswa kwalesi fragments kuyinto enhle ozichaza futhi kuyithuluzi eliwusizo kakhulu ukuba babe ebhande lakho.I-14. Tola ama-iPhonesuma ((navigator.userAgent.match (/ iPhone / i))) || (navigator.userAgent.match (/ iPod / i)) {if (document.cookie.indexOf ( "iphone_redirect = amanga") == -1) {windows.location = "http://m.espn.go.com/wireless/?iphone&i = COMR"; }}Izgriezuma fragmenta izkuvumela ukuba ubone ukuthi umbukeli wakho izmantošana-iPhone noma i-iPod evumela ukuthi ubonise okuqukethwe okuhlukile kubo. Lo mdlalo uzuzisa kakhulu kangakanani ukuthi imakethe yeselula ikhulu kangakanani futhi uzoqhubeka ukhula.I-15. Phrinta Umlayezo ku-Isimo BarJavaScript kuyinto isetshenziswe yonke indawo online kulezi zinsuku – ukency ngcono ukuxhumana kwewebhusayithi, ukuqinisekisaJavaScript kuyinto isetshenziswe yonke indawo online kulezi zinsuku – ukwenza ngcono ukuxhumana kwewebhusayithi, ukuqinisekisaJavaScript kuyinto isetshenziswe yonke indawo 온라인 kulezi zinsuku-ukwenza ngcono ukuxhumana kwewebhusayithi, ukuqinisekisa imininingwane, kanyeNoma ubani angakwazi qala ibhulogi-kodwa akuwona wonke umuntu ongaqala futhi agcine ibhulogi yekhwalithi ehlinzekaJavaScript kuyinto isetshenziswe yonke indawo online kulezi zinsuku – ukency ngcono ukuxhumana kwewebhusayithi, ukuqinisekisa imininingwane, kanye / noma ukuthuthukisa ukuphuma kwewebhusayithi.IJavaScript ivele okokuqala kwi-1995 futhi ifike gestion kusukela lapho ngokwemigomo yokwamukelwa nokuthi isetshenziswa kanjani. I-Sintaxa esetshenziswe kuJavaScript yathonywa ngokuqinele yi-C; kodwa iJava, Pearl, Python, ne-Scheme nayo nayo yadlala indima yayo.I-JavaScript ingavaliwe kusiphequluliI-JavaScript ithatha isikhathi ukulayisha ngokuxhumeka kwe-IntanethiKubalulekile futhi ukuqonda ukuthi iJavaScript empeleni izokuholela enhlekeleleni uma isetshenziswa ngendlela engafanele.Cha, angizami ukukusabisa ngala maphuzu.1 I-Freebies: I-15 Cool I-JavaScript Imiklamo Yewebhusayithi Yakho1.2 I-2. Amakhukhi weJavaScript1.8 I-8. Beka i-bookmark Ekhasini1.14 I-14. Thola ama-iPhonesI-Freebies: I-15 Cool I-JavaScript Imiklamo Yewebhusayithi Yakhoumsebenzi uyaqonda_video () {Return! document.createElement („video”). canPlayType; // boolean} uma (! ukuqonda_video ()) {// Kufanele kube yisipheqululisidala noma i-IE. // Mhlawumbe yenza into efana nokufihla izilawuli // HTML5 Izilawuli. Noma yini … videoControls.style.display = ‘niciunul’; }Snippet Yenzani i-JavaScript?Le snippet encane izokuvimbela iwebhusayithi yakho ukuthi izame ukubonisa ividiyo isiphequluli esinakukwazi ukusekela, ukulondoloza amandla omgwaqo kanye nokucubungula amandla.I-2. Amakhukhi weJavaScript/ ** * Imisa ikhukhi ngegama elinikeziwe nenani. * * Igama Igama le-cookie * Inani le-cookie * [liphelelwa yisikhathi] Isikhathi sokuphelelwa kukhukhi (okuzenzakalelayo: ukuphela kweseshini yamanje) * [indlela] Indlela lapho ikhukhi isebenza khona (okuzenzakalelama) ((ezenzakalelayo: isizinda sedokhumenti yokushayela) * [evikelekile] Inani le-Boolean elibonisa uma ngabe ukuhanjiswa kukhukhi kudinga ukuhanjiswa okuphephile * / ukusebenza setCookie (igama, inani, ukuphelelwa isikhat) + "=" + ukuphunyuka (inani) + ((kuphelelwa isikhathi)? "; kuphelelwa isikhathi =" + expir.toGMTString (): "") + ((indlela)? "; indlela =" + indlela: "") + ((isizinda)? "; domeniu =" + domeniu: "") + ((kuvikelekile)? "; kuvikelekile": ""); } / ** * Ithola inani le-cookie echaziwe. * * Igama Igama le-cookie oyifunayo. * * Ibuyisa intambo equkethe inani lekhukhi echaziwe, * noma i-null uma ikhukhi lingekho. * / funcție GetCookie (igama) {var dc = document.cookie; prefix var = igama + "="; var qala = dc.indexOf (";" + isiqalo); uma (qala == -1) {qala = dc.indexOf (isiqalo); uma (qala! = 0) buyela null; } okunye {qala + = 2; } var end = document.cookie.indexOf (";", Qala); uma (ukuphela == -1) {end = dc.length; } cumpără ubuwena (dc.substring (qala + prefix.length, end)); } / ** * Unamathisela ikhukhi elibekiwe. * * Igama legama le-cookie * [indlela] yendlela yekhukhi (kumele ifane nendlela esetshenziselwa ukudala ikhukhi) * domeniu [domeniu] al cookie-ului (kumele ilingane nesizinda esisetshenziselwe ukudala ikhukhi) * / funcția DeleCookie (igama, indlela) (GetCookie (igama)) {document.cookie = igama + "=" + ((Indlela)? "; calea =" + indlela: "") + ((domeniu)? "; isizinda = "+ domeniu:" ") +"; expiră = Joi, 01 ianuarie-70 00: 00: 01 GMT "; }}Yenzani i-JavaScript fragment?Le snippet isikhashana kodwa iwusizo kakhulu, izovumela isayithi lakho ukuthi ligcine ulwazi kwikhompyutha yombukeli bese lifunda kwelinye iphuzu ngesikhathi. Le snippet ingasetshenziswa ngezindlela eziningi ezahlukene zokufeza imisebenzi ehlukile.Le snippet izovimbela isayithi lakho ukuthi lingabi nesikhathi esibucayi lapho ibonisa kuphela ingxenye yesayithi; Lokhu akukona nje kubukeka kubi kodwa futhi akusizi ngalutho. Konke okumele ukwenze wengeze izithombe zakho esigabeni sokulayisha kuqala futhi ulungele ukugoqa.umsebenzi uqinisekisaEmail (theForm) {if (/ ^ w + audiotaurwa-> /.test(theForm.email-id.value)) {cumpărați (iqiniso); } isexwayiso ("Ikheli le-imeyili elingavumelekile! Sicela ufake futhi ngokucophelela !."); buyela (ngamanga); }Le-snippet izokuqinisekisa ukuthi ikheli le-imeyili elifomethwe kahle lifakwe kwifomu, alinakuqinisekisa ukuthi ikheli le-imeyili langempela, akukho ndlela yokukuhlola lokho ngeJavaScriptScript.umsebenzi f1 () {uma (amaphepha.all) {buyela amanga; }} sebenza f2 (e) {if (document.layers || (document.getElementById) &! document.all)) {if (e.which == 2 || e.which == 3) {buyela amanga; }}} uma (document.layers) {imibhalo.captureEvents (Umcimbi.MOUSEDOWN); idokhumenti.onmousedown = f1; } okunye {document.onmouseup = f2; umqulu.oncontextmenu = f1; } idokhumenti.oncontextmenu = umsebenzi omusha ("buyisa amanga");Le snippet izovimbela umbukeli ukuba akwazi ukuchofoza ngakwesokudla ekhasini lakho. Lokhu kunganciphisa umsebenzisi ojwayelekile ukuboleka izithombe noma ikhodi kusuka kusayithi lakho.Cap: bhalaRandomQuote = umsebenzi () {var quotes = Array entsha (); izingcaphuno [0] = "Isenzo yisilinganiso sangempela sobuhlakani."; izingcaphuno [1] = "I-baseball inenzuzo enkulu phezu kwekhilikithi yokuthi isheshe iphele."; izingcaphuno [2] = "Yonke inhloso, yonke isenzo, yonke imicabango, nakho konke ukuzwa, noma ngabe kukaziwa noma kungaziwa, ngumzamo wokukhulisa izinga lokuthula kwengqondo."; izingcaphuno [3] = "Inhloko enhle nenhliziyo enhle zihlala ziyinhlanganisela ebabazekayo."; var rand = Math.floor (Math.random () * izingcaphuno.length); umqulu.write (izingcaphuno [zamarandi]); } bhalaRandomQuote ();I-8. Beka i-bookmark EkhasiniCap: show showDate () {var d = usuku olusha (); var curr_date = d.getDate (); var curr_month = d.getMonth () + 1; // izinyanga zero-zero curr_year = d.getFullYear (); umqulu.write (curr_date + "-" + curr_month + "-" + curr_year); }Le snippet izokuvumela ukuba ubonise usuku lwamanje noma kuphi ekhasini lakho lewebhu futhi akudingeki libuyekezwe. Mane nje uyibeke endaweni futhi ukhohlwe ngakho.Cap: i-function addCommas (inombolo) {num + = ”; var n1 = inombolo.split (‘.’); var n2 = n1 [0]; var n3 = n1.lungime> 1? ” + n1 [1]: ”; var temp = / (d +) (d {3}) /; ngenkathi (temp.test (n2)) {n2 = n2.replace (temp, ” + ‘,’ + ”); } var out = Returnare n2 + n3; umqulu.bhala (ngaphandle); }Le snippet ingasetshenziswa ikakhulukazi amasayithi asebenzisa izinombolo kaningi. Le snippet izogcina izinombolo zakho zibukeka ezifanayo ebhodini. Konke okumele ukwenze ukukopisha umugqa womzimba lapho ufuna ukwengeza khona inombolo bese ushintsha inombolo lapho ngenombolo yakho.Ububanzi besikhathi sakho sokubuka ngu ‘+ viewportwidth +’ x ‘+ viewportheight +’„); // ->Le snippet izokuvumela ukuthi uthole ububanzi nokuphakama kwendawo yokubonisa kusiphequluli sakho sokubukwa. Lokhu kuzonikeza umklami ikhono lokudala nokusebenzisa izibonisi caracterhlukene ngokususelwa kusayizi wesiphequluli sesiphequluli somsebenzisi.Le snippet izokuvumela ukuba uqondise kabusha ababukeli bakho kwenye ikhasi futhi unendlela yokubeka ukulibaziseka. Ukusetshenziswa kwalesi snippet kuyinto enhle ozichaza futhi kuyithuluzi eliwusizo kakhulu ukuba babe ebhande lakho.I-14. Thola ama-iPhonesuma ((navigator.userAgent.match (/ iPhone / i)) || (navigator.userAgent.match (/ iPod / i)) {if (document.cookie.indexOf ( "iphone_redirect = amanga") == -1) {windows.location = "http://m.espn.go.com/wireless/?iphone&i = COMR"; }}Le snippet izokuvumela ukuba ubone ukuthi umbukeli wakho use-iPhone noma i-iPod evumela ukuthi ubonise okuqukethwe okuhlukile kubo. Lo mdlalo uzuzisa kakhulu kangakanani ukuthi imakethe yeselula ikhulu kangakanani futhi utilizareqhubeka ukhula.
