Thursday 1 December 2016

Latest jQuery interview questions and answers for freshers and experienced

                Hi friends in this article I will explain about Latest jQuery interview questions and answers for freshers and experienced.The below questions and answers will help in interview.

What is JQuery?
Jquery is a fast,cross-browser lightweight "write less, do more", JavaScript library. JQuery also simplifies a lot of the complicated things from JavaScript, like AJAX calls and DOM manipulation.

Difference between $(document).ready() and $(window).load
1.we can can more than one $(document).ready() but we can use only one $(window).load
2.document.ready() function is called as soon as DOM is loaded where body.onload() function is called when everything gets loaded on the page that includes DOM, images and all associated resources of the page.

What is JQuery.noConflict?
As other client side libraries like MooTools, Prototype can be used with jQuery and they also use $() as their global function and to define variables. This situation creates conflict as $() is used by jQuery and other library as their global function. To overcome from such situations, jQuery has introduced jQuery.noConflict().
When we use jQuery noConflict mode, we are replacing the $ to a new variable and assigning to jQuery some other JavaScript libraries
You can of course still use jQuery, simply by writing the full name instead of the shortcut
var jnc = $.noConflict();
jnc(document).ready(function(){
   jnc("button").click(function(){
        jnc("p").text("using this also jQuery is working!");
    });
});

What is a CDN?
content delivery network or content distribution network (CDN) is a large distributed system of servers deployed in multiple data centers across the Internet. The goal of a CDN is to serve content to end-users with high availability and high performance.

What is the use of jQuery .each() function?
The each() method specifies a function to run for each matched element.
Example:
 $(document).ready(function() {
 //for radiobuttonlist checking.
                $('.rbl').each(function() {
                    var checked = $(this).find('input:radio:checked');
                    if (checked.length == 0) {
                        alert("pls select atleast one radio button");
                        return;
                    }
                    else {
                        if (checked.val() == 1) { alert("checked 1"); }
                        if (checked.val() == 2) { alert("checked 2"); }
                        if (checked.val() == 3) { alert("checked 3"); }

                    }
                });

What is difference between prop and attr?
attr() gives you the value of element as it was defines in the html on page load. It is always recommended to use prop() to get values of elements which is modified via javascript/jquery , as it gives you the original value of an element's current state.
<input type="text" value="txt" id="test"/>
$('#tbl1').change(function(){
    alert('attr(): '+$(this).attr('value'));  //shows txt
    alert('prop(): '+$(this).prop('value')); //shows the textbox's new  value
});

  

10 comments:

  1. This blog is really very well done as i am looking forward more things from your blog, your blog is really interesting keep it up.....

    Best Implant Clinic In Chennai | Best Laser Clinic In Chennai | Best Dental Clinic In Vellore

    ReplyDelete
  2. This blog is very well done, i also got more interest in learning software courses, so please say about those things in a detail manner.

    Web Design Company in Chennai

    ReplyDelete
  3. This blog having the details of Processes running. The way of runing is explained clearly. The content quality is really great. The full document is entirely amazing. Thank you very much for this blog.
    Seo Company in Chennai

    ReplyDelete
  4. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.

    Hadoop Training in Chennai

    ReplyDelete
  5. Great post!I am actually getting ready to across this information,i am very happy to this commands.Also great blog here with all of the valuable information you have.Well done,its a great knowledge.

    Digital Marketing Company in India

    ReplyDelete
  6. This article is very much helpful and i hope this will be an useful information for the needed one. Keep on updating these kinds of informative things.
    best seo training institute

    ReplyDelete
  7. I just see the post i am so happy to the communication science post of information's.So I have really enjoyed and reading your blogs for these posts.Any way I’ll be replay for your great thinks and I hope you post again soon.
    .Net Development Services
    Hire .Net Developers India

    ReplyDelete

© 2012-2018 Aspdotnet-Kishore.blogspot.com. All Rights Reserved.
The content is copyrighted to Kishore and may not be reproduced on other websites without permission from the owner.