The Complete Project Source Code Platform

Kashipara.com is a community of ONE million programmers and students, Just like you, Helping each other.Join them. It only takes a minute: Sign Up

Buy a laptop for coding and programming Buy a programming books

latest jQuery Job Interview Questions And Answers


Why don't preparation your interviews. Best and top asking questions jQuery questions and answers. Prepare your job jQuery interview with us. Most frequently asked questions in jQuery interview. Top 10 most common jQuery interview questions and answer to ask. jQuery most popular interview question for fresher and experiences. We have good collection of jQuery job interview questions and answers. Ask interview questions and answers mnc company.employee ,fresher and student. jQuery technical questions asking in interview. Complete placement preparation for major companies tests and jQuery interviews,Aptitude questions and answers, technical, interview tips, practice tests, assessment tests and general knowledge questions and answers.


Free Download jQuery Questions And Answers Pdf.


latest jQuery FAQ jQuery Interview Questions and Answers for Experiences and Freshers.



how to use ajax call in bootstrap typeahead using database ?

first include boostrap js and


<div class="controls">
                                <input placeholder="Search Category" id="categoryTypeahead" type="text" class="categoryTypeahead"  />
                                <input id="categoryID" name="categoryID" type="hidden"/>
                            </div>

java script

<script type="text/javascript" >
var finished = true;
            $('.categoryTypeahead').typeahead({
                source: function(query, process) {
                    if(!finished) {
                        return;
                    }
                    finished = false;
                    return $.ajax({
                        url: 'category.php',
                        type: 'post',
                        displayField: "name",
                        data: {type:'typeaheadSearchCategory',categoryName: query},
                        dataType: 'json',
                        success: function(response) {  
                            var data = new Array();
                            for(var i in response.data) {
                                data.push(response.data[i]['categoryID']+'|'+response.data[i]['categoryName']);
                            }
                            process(data);
                            finished = true;
                        }
                    });
                },
                highlighter: function(item) {
                    var parts = item.split('|');
                    parts.shift();
                    return parts.join('|');
                },
                updater: function(item) {
                    var parts = item.split('|');                                                                      
                    $('.selectedCategory').text(parts[1]);
                    $('#categoryID').attr('value',parts.shift());                        
                    return parts.join('|');
                }
            })
</script>

json data in php file

{"data":[{"categoryID":"1","categoryName":"jQuery"}]}

jQuery   2014-01-23 10:45:52

What are various methods to make ajax request in jQuery?

Using below jQuery methods, you can make ajax calls.

load() : Load a piece of html into a container DOM
$.getJSON(): Load JSON with GET method.
$.getScript(): Load a JavaScript file.
$.get(): Use to make a GET call and play extensively with the response.
$.post(): Use to make a POST call and don't want to load the response to some container DOM.
$.ajax(): Use this to do something on XHR failures, or to specify ajax options (e.g. cache: true) on the fly.

jQuery   2014-01-06 08:24:54

Can we use jQuery to make ajax request?

Yes. jQuery can be used for making ajax request.

jQuery   2014-01-06 08:24:16

Can you include multiple version of jQuery?

Yes. Multiple versions of jQuery can be included in same page.
Below code shows how to include multiple version of jQuery.

<script src="js/jquery_1.9.1.min.js" type="text/javascript"></script>
 
<script type="text/javascript">
 var $jq = jQuery.noConflict();
</script>
 
<script src="js/jquery_1.7.2.min.js" type="text/javascript"></script>

By this way, for your own jQuery code use "$jq", instead of "$" as "$jq" refers to jQuery 1.9.1, where "$" refers to 1.7.2. 

jQuery   2014-01-06 08:23:46

How do you attach a event to element which should be executed only once?

Using jQuery one() method. This attaches a handler to an event for the element. The handler is executed at most once per element. In simple terms, the attached function will be called only once.

$(document).ready(function() {
    $("#btnDummy").one("click", function() {
        alert("This will be displayed only once.");
    });
});​

jQuery   2014-01-06 08:22:52

How to check data type of any variable in jQuery?

Using $.type(Object) which returns the built-in JavaScript type for the object.

jQuery   2014-01-06 08:22:17

How to check if number is numeric while using jQuery 1.7+?

Using "isNumeric()" function which was introduced with jQuery 1.7.

jQuery   2014-01-06 08:21:52

What is the difference between event.PreventDefault and "return false"?

e.preventDefault() will prevent the default event from occurring, e.stopPropagation() will prevent the event from bubbling up and return false will do both.

jQuery   2014-01-06 08:21:26

What is event.PreventDefault?

The event.preventDefault() method stops the default action of an element from happening.

jQuery   2014-01-06 08:20:50

What is difference between prop and attr?

attr(): Get the value of an attribute for the first element in the set of matched elements. Whereas,.prop(): (Introduced in jQuery 1.6) Get the value of a property for the first element in the set of matched elements. 
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. 

jQuery   2014-01-06 08:20:13

How to create clone of any object using jQuery?

jQuery provides clone() method which performs a deep copy of the set of matched elements, 
meaning that it copies the matched elements as well as all of their descendant elements and text nodes.

$(document).ready(function(){
  $('#btnClone').click(function(){
     $('#dvText').clone().appendTo('body');
     return false;
  });
});

jQuery   2014-01-06 08:19:39

Explain .bind() vs .live() vs .delegate() vs .on()

All these 4 jQuery methods are used for attaching events to selectors or elements. But they all are different from each other.
.bind(): This is the easiest and quick method to bind events.
But the issue with bind() is that it doesn't work for elements added dynamically that matches the same selector. 
bind() only attach events to the current elements not future element.
Above that it also has performance issues when dealing with a large selection.

.live(): This method overcomes the disadvantage of bind(). 
It works for dynamically added elements or future elements. 
Because of its poor performance on large pages, this method is deprecated as of jQuery 1.7 and you should stop using it. 
Chaining is not properly supported using this method.

.delegate(): The .delegate() method behaves in a similar fashion to the .live() method, 
but instead of attaching the selector/event information to the document, 
you can choose where it is anchored and it also supports chaining.

.on(): Since live was deprecated with 1.7, so new method was introduced named ".on()". 
This method provides all the goodness of previous 3 methods and it brings uniformity for attaching event handlers.

jQuery   2014-01-06 08:18:50

What is the difference between parent() and parents() methods in jQuery?

The basic difference is the parent() function travels only one level in the DOM tree, 
where parents() function search through the whole DOM tree.

jQuery   2014-01-06 08:16:06

What is the difference between $('div') and $('<div\/>') in jQuery?

$('<div\/>') : This creates a new div element. However this is not added to DOM tree unless you don't append it to any DOM element.
$('div') : This selects all the div element present on the page.

jQuery   2014-01-06 08:15:38

What is the difference between jquery.size() and jquery.length?

jQuery .size() method returns number of element in the object. 
But it is not preferred to use the size() method as jQuery provide .length property and which does the same thing. 
But the .length property is preferred because it does not have the overhead of a function call.

jQuery   2014-01-06 08:15:02

What is the use of jquery .each() function?

The $.each() function is used to iterate over a jQuery object. 
The $.each() function can be used to iterate over any collection, whether it is an object or an array.

jQuery   2014-01-04 09:24:30

How do you check if an element exists or not in jQuery?

$(document).ready(function(){
    if ($('#element').length > 0){
       //Element exists
  });
});

jQuery   2014-01-04 09:24:04

How do you check if an element is empty?

There are 2 ways to check if element is empty or not.
We can check using ":empty" selector.

$(document).ready(function(){
    if ($('#element').is(':empty')){
       //Element is empty
  }
});

And the second way is using the "$.trim()" method.

$(document).ready(function(){
    if($.trim($('#element').html())=='') {
       //Element is empty
  }
});

jQuery   2014-01-04 09:23:33

Difference between $(this) and 'this' in jQuery?

this and $(this) refers to the same element. The only difference is the way they are used. 'this' is used in traditional sense, when 
'this' is wrapped in $() then it becomes a jQuery object and you are able to use the power of jQuery.

$(document).ready(function(){
    $('#spnValue').mouseover(function(){
       alert($(this).text());
  });
});

In below example, this is an object but since it is not wrapped in $(), we can't use jQuery method and use the native JavaScript to get the value of span element.   

$(document).ready(function(){
    $('#spnValue').mouseover(function(){
       alert(this.innerText);
  });
});

jQuery   2014-01-04 09:16:50




latest jQuery questions and answers for experienced


jQuery best Interview Questions have been designed especially to get you acquainted with the nature of questions you may encounter during your interview for the subject of jQuery Programming Language. here some questions that helpful for your interview. jQuery 2024 job interview questions with answers. jQuery for employee and fresher. Here we present some more challenging practice jQuery interview questions and answers that were asked in a real interview for a jQuery developer position. These questions are really good to not just test your jQuery skills, but also your general development knowledge. jQuery programming learning. we hope this jQuery interview questions and answers would be useful for quick glance before going for any jQuery job interview.