Babban matsalar ita ce ba ku amfani da CDN. CDN cibiyar sadarwa ce ta isar da abun ciki wacce ke taimakawa don rarraba abubuwan cikin shafin yanar gizon ku a cikin sabar da yawa a duniya. Wannan zai iya taimakawa wajen rage lokacin lodi na shafinku kuma ya sa ya yi sauri ga masu amfani.
You can add jQuery to the console by typing the following: jQuery.noConflict();
Wannan layin lambar yana ƙara jQuery zuwa na'ura wasan bidiyo.
Get
Akwai 'yan hanyoyi don shiga jQuery. Hanya ɗaya ita ce amfani da aikin $(). Wannan aikin yana ɗaukar wani kashi azaman ma'auni kuma yana mayar da shi azaman abu jQuery. Hakanan zaka iya amfani da hanyoyin jQuery daban-daban akan wannan abu don aiki tare da kashi.
Wata hanyar shiga jQuery ita ce amfani da aikin document.getElementById(). Wannan aikin yana ɗaukar ID azaman ma'auni kuma yana dawo da abin da ya dace daga bishiyar takaddar. Kuna iya amfani da hanyoyin jQuery daban-daban akan wannan kashi don yin aiki da shi.
Yi aiki tare da url
Ɗayan amfani gama gari na URLs a jQuery shine ɗaure su zuwa abubuwan DOM. Misali, zaku iya amfani da URL don ɗaure wani yanki zuwa takamaiman jere a cikin tebur:
$("# tebur"). daure ("jere", {id: "jere1"});
Hakanan zaka iya amfani da URLs don ɗaure abubuwa zuwa takamaiman ginshiƙai a cikin tebur:
$("# tebur"). daure ("column", {id: "col1"});
Hakanan zaka iya amfani da URLs don ɗaure abubuwa zuwa takamaiman sel a cikin tebur:
$("# tebur"). daure ("cell", {id: "cell1"});