Está en la página 1de 5

1)WhatisjQuery?

jQueryisafast,lightweight,feature-richclientsideJavaScriptframework.Ithasprovideda
muchneededboosttoJavaScript.BeforejQuery,JavaScriptcodeswerelengthyandbigger,even

m
forsmallerfunctionality.

2)IsjQueryaprogramminglanguage?

.co
jQueryisnotaprogramminglanguagebutawellwrittenJavaScriptcode.Itisusedtotraverse
documents,eventhandling,AjaxinteractionandAnimation.

3)WhatisthedifferencebetweenJavaScriptandjQuery?
ThesimpledifferenceisthatJavaScriptisalanguagewhilejQueryisabuilt-inlibrarybuiltof
JavaScript.jQuerysimplifiestheuseofJavaScriptlanguage.

4)IsjQueryreplacementofJavaScript? m
No,jQueryisnotthereplacementofJavaScript.jQueryiswrittenonthetopofJavaScriptandit
ar
isadifferentlibrary.jQueryislightweightJavaScriptlibrarywhichisusedtointeractJavaScript
andHTML.

5)WhydoweusejQuery?
er

Itisveryeasytolearnanduse.

Itisusedtodevelopbrowsercompatiblewebapplications.

Itimprovestheperformanceofanapplication.

Itisveryfastandextensible.
re

ItfacilitatesyoutowriteminimallinesofcodesforUIrelatedfunctions.

Itprovidesacross-browsersupport.
Ca

6)WhataretheeffectsmethodsusedinjQuery?
ThesearesomeeffectsmethodsusedinjQuery:

show()

hide()

toggle()

fadeIn()
fadeOut()

7)IsitpossiblethatjQueryHTMLworkforbothHTMLandXML
document?

m
No,jQueryHTMLonlyworksforHTMLdocument.Itdoesn'tworkforXMLdocuments.

8)Whatis$()injQuerylibrary?

.co
The$()functionisanaliasofjQuery()function.ItisusedtowrapanyobjectintojQueryobject
whichlaterfacilitatesyoutocallvariousmethoddefinedjQueryobject.Youcanpassaselector
stringto$()functionanditwillreturnjQueryobjectwhichcontainsanarrayofallmatchedDOM
elements.

9)IsjQuerylibraryusedforserverscriptingorclientscripting?

m
ItisalibraryforclientsideScripting.

10)IsjQueryaW3Cstandard?
ar
No,jQueryisnotaW3Cstandard.

11)WhatisthestartingpointofcodeexecutioninjQuery?
er

$(document).ready()functionisthestartingpointofjQuerycode.ItisexecutedwhenDOMis
loaded.
re

12)WhatisthebasicrequirementtostartwiththejQuery?
YouneedtomakereferenceofitslibrarytostartwithjQuery.Youcandownloadthelatest
versionofjQueryfromjQuery.com.
Ca

13)Canyouuseaspecialcharacterinplaceof$(dollarsign)in
jQuery?
Yes.

14)Canyouusemultipledocument.ready()functiononthesame
page?
Yes.Youcanuseanynumberofdocument.ready()functiononthesamepage.

m
15)Whatisthedifferencebetweenfindandchildrenmethods?
FindmethodisusedtofindalllevelsdowntheDOMtreewhilechildrenmethodisusedtofind
singleleveldowntheDOMtree.

.co
16)WhatisaCDN?
CDNstandsforContentDeliveryNetworkorContentDistributionNetwork.Itisalarge
distributedsystemsofserversdeployedinmultipledatacentersacrosstheinternet.

17)WhatisthegoalofCDNandwhataretheadvantagesofusing
CDN?
m
ThemaingoaloftheCDNistoprovidecontenttotheend-userswithhighavailabilityandhigh
performance.
ar
AdvantagesofusingCDN:

Itreducestheloadfromtheserver.

Itsavesbandwidth.jQueryframeworkisloadedfasterfromtheseCDN.

IfauservisitsregularlyasitewhichisusingjQueryframeworkfromanyoftheseCDN,it
er

willbecached.

18)HowcanyouusejQuerylibraryinyourproject?
re

YoucanusejQuerylibraryinASP.NetprojectfromdownloadingthelatestjQuerylibraryfrom
jQuery.comandincludethereferencestothejQuerylibraryfileinyourHTML/PHP/JSP/Aspx
page.

<scriptsrc="_scripts/jQuery-1.2.6.js"type="text/javascript">
Ca

</ script>
<scriptlanguage="javascript">
$(document).ready(function(){
alert('test')
})
</ script>
19)WhatareselectorsinjQuery?Howmanytypesofselectorsin
jQuery?
Ifyouwanttoworkwithanelementonthewebpage,firstyouneedtofindit.Selectorsare
usedtofindtheHTMLelementsinjQuery.Therearemanytypesofselectors.Somebasic

m
selectorsare:

Nam e:ItisusedtoselectsallelementswhichmatchwiththegivenelementName.

#I D:ItisusedtoselectsasingleelementwhichmatcheswiththegivenID

.co
.Class:ItisusedtoselectsallelementswhichmatchwiththegivenClass.

U niversal(*):ItisusedtoselectsallelementsavailableinaDOM.

MultipleElem entsE,F,G:Itisusedtoselectsthecombinedresultsofallthespecified
selectorsE,ForG.

AttributeSelector:Itisusedtoselectelementsbasedonitsattributevalue.

20)WhatisuseofjQueryfilter?
m
:jQueryfilterisusedtofilterthecertainvaluesfromtheobject.Itfilterstheresultofyour
originalqueryintospecificelements.
ar
21)WhatarethedifferenttypesofselectorsinjQuery?
TherearethreetypesofselectorsinjQuery:

CSSSelector
er

CustomSelector

XPathSelector

22)WhatisthedifferencebetweenIDselectorandclassselectorin
re

jQuery?
IDselectorandclassselectoraresameliketheyareusedinCSS.IDselectorusesIDwhileclass
selectorusesclasstoselectelements.
Ca

Ifyouneedtoselectjustoneelement,useIDselector.Ifyouwanttoselectagroupof
elements,havingsameCSSclass,useclassselector.

23)HowtoaddandremoveCSSclassestoanelementusingjQuery?
Youcanuseaddclass()jQuerymethodtoaddCSSclasstoanelementandremoveclass()jQuery
methodtoremoveCSSclassfromanelement.
24)CanyouwriteajQuerycodetoselectalllinksinsidethe
paragraph?
Yes.Youcanuse<a>tagnestedinsideparagraph<p>tagtoselectalllinks.

m
25)Whatisthedifferencebetweenpropandattr?
attr():Itgetsthevalueofanattributeforthefirstelementinthesetofmatchedelement.

.co
prop():itgetsthevalueofapropertyforthefirstelementinthesetofmatchedelements.Itis
introducedinjQuery1.6.

26)WhatarethetwotypesofCDNs?
TherearetwotypesofCDN:

m
Microsoft:ItloadsjQueryfromAJAXCDN.

Google:ItloadsjQueryfromGooglelibrariesAPI.
ar
27)WhatistheuseofanimatefunctioninjQuery?
Theanimatefunctionisusedtoapplythecustomanimationeffecttoelements.Syntax:

$(selector).animate({params},[duration],[easing],[callback])
er

Here,

"param"definestheCSSpropertiesonwhichyouwanttoapplytheanimation.

"duration"specifyhowlongtheanimationwillrun.Itcanbeoneoffollowingvalues:
re

"slow","fast","normal"ormilliseconds

"easing"isthestringwhichspecifythefunctionforthetransition.

"callback"isthefunctionwhichwewanttorunoncetheanimationeffectiscomplete.
Ca

También podría gustarte