Top *10 * Jquery Interview Questions

Spread the love


Jquery Interview Questions

jquery is one of the richest javascript libraries for clients side scripting.due to open source in nature it is most widely used javascript framework.” write less and do more ” is motto of ry.due to simple syntax and best way of building Ajax applications jquery became popular among developers.
.due to simple syntax and best way of building Ajax applications jquery became popular among developers.
here are some important jquery interview questions for a candidate.

1) How to handel events of dynamically created elements using jquery:
ANS: Sometime we need to create some dynamic HTML elements in view like buttons, checkboxes, radio etc. at this time simple jquery events handling will not work,so using following code we can

<script>
$('body').on("click",".del_record_harrts",function(e){
e.preventDefault();
// you action code
});
</script>

 

2) what is jquery noconflict:
ANS: multiple javascript library use $ in code so it will create ambiguity in application so jQuery.noConflict reset $ variable so it will no longer an alias of jquery.if you want to te your own variable instead of $.

ex:



</script>
    jQuery.noConflict();
   // first use
    var jq = jQuery.noConflict();
    // second use
<script>

 

3)What is a CDN(Content Delivery Network)??
ANS:CDN Stands for Content Delivery Network it is collection of servers for libraryes and site content sources.it is large network of servers. in CDN each request goes to nearest servers.

4)Which are Selectors in Jquery?
ANS: selectors are useful while handling events and data manuplutations.in jquery multiple selectors are available
1)ID:
in this type of selectors, the element is manipulated based on id of particular element.
2)Class:
the element is manipulated and handled on the basis of classss of that elemnats.
3)Tag
Elements are manipulated and handled basis on tag name.

Ex:

<script>
$("document").ready(function(){
    $("#elementid").click(function(){
    // your code here
    });
    $(".element_classname").click(function(){
    // your code here
    });
   $("button").click(function(){
   // your code here
   });
});
</script>

 

You May Like Also :

Leave a Reply

Your email address will not be published. Required fields are marked *

Geekbaba.org - Hot News ,Tutorials,Tips & Tricks,Entertainment,Sports,Business World. © 2017