Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
179 views

JQuery Interview Questions and Answers

jQuery is a fast, lightweight JavaScript library that simplifies HTML document traversal and manipulation, as well as event handling, CSS animation, and Ajax interactions for rapid web development. It allows developers to write less code using a simplified syntax. While JavaScript is a programming language, jQuery is a library built on top of JavaScript that allows developers to easily select elements, handle events, perform animations and Ajax interactions.

Uploaded by

Shailesh M Sass
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
179 views

JQuery Interview Questions and Answers

jQuery is a fast, lightweight JavaScript library that simplifies HTML document traversal and manipulation, as well as event handling, CSS animation, and Ajax interactions for rapid web development. It allows developers to write less code using a simplified syntax. While JavaScript is a programming language, jQuery is a library built on top of JavaScript that allows developers to easily select elements, handle events, perform animations and Ajax interactions.

Uploaded by

Shailesh M Sass
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

1)WhatisjQuery?

jQueryisafast,lightweight,feature-richclientsideJavaScriptframework.Ithasprovideda
forsmallerfunctionality.

.co

2)IsjQueryaprogramminglanguage?

muchneededboosttoJavaScript.BeforejQuery,JavaScriptcodeswerelengthyandbigger,even

jQueryisnotaprogramminglanguagebutawellwrittenJavaScriptcode.Itisusedtotraverse
documents,eventhandling,AjaxinteractionandAnimation.

3)WhatisthedifferencebetweenJavaScriptandjQuery?

ThesimpledifferenceisthatJavaScriptisalanguagewhilejQueryisabuilt-inlibrarybuiltof

JavaScript.jQuerysimplifiestheuseofJavaScriptlanguage.

4)IsjQueryreplacementofJavaScript?

ar

No,jQueryisnotthereplacementofJavaScript.jQueryiswrittenonthetopofJavaScriptandit
isadifferentlibrary.jQueryislightweightJavaScriptlibrarywhichisusedtointeractJavaScript
andHTML.

er

5)WhydoweusejQuery?

Itisveryeasytolearnanduse.

Itisusedtodevelopbrowsercompatiblewebapplications.
Itimprovestheperformanceofanapplication.

re

Itisveryfastandextensible.

ItfacilitatesyoutowriteminimallinesofcodesforUIrelatedfunctions.

Ca

Itprovidesacross-browsersupport.

6)WhataretheeffectsmethodsusedinjQuery?
ThesearesomeeffectsmethodsusedinjQuery:
show()
hide()

toggle()

fadeIn()

fadeOut()

7)IsitpossiblethatjQueryHTMLworkforbothHTMLandXML
document?

8)Whatis$()injQuerylibrary?

.co

No,jQueryHTMLonlyworksforHTMLdocument.Itdoesn'tworkforXMLdocuments.

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

9)IsjQuerylibraryusedforserverscriptingorclientscripting?
ItisalibraryforclientsideScripting.

ar

10)IsjQueryaW3Cstandard?
No,jQueryisnotaW3Cstandard.

er

11)WhatisthestartingpointofcodeexecutioninjQuery?
$(document).ready()functionisthestartingpointofjQuerycode.ItisexecutedwhenDOMis

re

loaded.

12)WhatisthebasicrequirementtostartwiththejQuery?
YouneedtomakereferenceofitslibrarytostartwithjQuery.Youcandownloadthelatest

Ca

versionofjQueryfromjQuery.com.

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

14)Canyouusemultipledocument.ready()functiononthesame

page?

Yes.Youcanuseanynumberofdocument.ready()functiononthesamepage.

15)Whatisthedifferencebetweenfindandchildrenmethods?

FindmethodisusedtofindalllevelsdowntheDOMtreewhilechildrenmethodisusedtofind

.co

singleleveldowntheDOMtree.

16)WhatisaCDN?

CDNstandsforContentDeliveryNetworkorContentDistributionNetwork.Itisalarge
distributedsystemsofserversdeployedinmultipledatacentersacrosstheinternet.

17)WhatisthegoalofCDNandwhataretheadvantagesofusing
CDN?

ThemaingoaloftheCDNistoprovidecontenttotheend-userswithhighavailabilityandhigh

ar

performance.
AdvantagesofusingCDN:

Itreducestheloadfromtheserver.

Itsavesbandwidth.jQueryframeworkisloadedfasterfromtheseCDN.

er

IfauservisitsregularlyasitewhichisusingjQueryframeworkfromanyoftheseCDN,it
willbecached.

re

18)HowcanyouusejQuerylibraryinyourproject?
YoucanusejQuerylibraryinASP.NetprojectfromdownloadingthelatestjQuerylibraryfrom
jQuery.comandincludethereferencestothejQuerylibraryfileinyourHTML/PHP/JSP/Aspx
page.

Ca

<scriptsrc="_scripts/jQuery-1.2.6.js"type="text/javascript">
</ script>
<scriptlanguage="javascript">
$(document).ready(function(){
alert('test')
})

</ script>

19)WhatareselectorsinjQuery?Howmanytypesofselectorsin
jQuery?
Ifyouwanttoworkwithanelementonthewebpage,firstyouneedtofindit.Selectorsare

usedtofindtheHTMLelementsinjQuery.Therearemanytypesofselectors.Somebasic
selectorsare:

Nam e:ItisusedtoselectsallelementswhichmatchwiththegivenelementName.

.co

#I D:ItisusedtoselectsasingleelementwhichmatcheswiththegivenID
.Class:ItisusedtoselectsallelementswhichmatchwiththegivenClass.
U niversal(*):ItisusedtoselectsallelementsavailableinaDOM.

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

AttributeSelector:Itisusedtoselectelementsbasedonitsattributevalue.

20)WhatisuseofjQueryfilter?

:jQueryfilterisusedtofilterthecertainvaluesfromtheobject.Itfilterstheresultofyour

ar

originalqueryintospecificelements.

21)WhatarethedifferenttypesofselectorsinjQuery?
TherearethreetypesofselectorsinjQuery:

er

CSSSelector

CustomSelector
XPathSelector

re

22)WhatisthedifferencebetweenIDselectorandclassselectorin
jQuery?
IDselectorandclassselectoraresameliketheyareusedinCSS.IDselectorusesIDwhileclass

Ca

selectorusesclasstoselectelements.

Ifyouneedtoselectjustoneelement,useIDselector.Ifyouwanttoselectagroupof

elements,havingsameCSSclass,useclassselector.

23)HowtoaddandremoveCSSclassestoanelementusingjQuery?
Youcanuseaddclass()jQuerymethodtoaddCSSclasstoanelementandremoveclass()jQuery
methodtoremoveCSSclassfromanelement.

24)CanyouwriteajQuerycodetoselectalllinksinsidethe
paragraph?

Yes.Youcanuse<a>tagnestedinsideparagraph<p>tagtoselectalllinks.

25)Whatisthedifferencebetweenpropandattr?

.co

attr():Itgetsthevalueofanattributeforthefirstelementinthesetofmatchedelement.

prop():itgetsthevalueofapropertyforthefirstelementinthesetofmatchedelements.Itis
introducedinjQuery1.6.

TherearetwotypesofCDN:

26)WhatarethetwotypesofCDNs?

Microsoft:ItloadsjQueryfromAJAXCDN.

ar

Google:ItloadsjQueryfromGooglelibrariesAPI.

27)WhatistheuseofanimatefunctioninjQuery?
Theanimatefunctionisusedtoapplythecustomanimationeffecttoelements.Syntax:

Here,

er

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

"param"definestheCSSpropertiesonwhichyouwanttoapplytheanimation.

re

"duration"specifyhowlongtheanimationwillrun.Itcanbeoneoffollowingvalues:
"slow","fast","normal"ormilliseconds
"easing"isthestringwhichspecifythefunctionforthetransition.

Ca

"callback"isthefunctionwhichwewanttorunoncetheanimationeffectiscomplete.

You might also like