1. Question:What is the function of jQuery? 

    Answer
    jQuery is a new kind of JavaScript Library. It does perform so many different functions such as HTML document traversing, event handling, animating e.t.c.

    1. Report
  2. Question:What are the three building blocks for selecting element used in jQuery? 

    Answer
    Three building blocks while selection elements in a given document:
    A)	Tag Name     B) Tag ID     C) Tag Class

    1. Report
  3. Question:Write the functions of hasClass and html methods. 

    Answer
    hasClass(class): Returns true if the specified class is present on at least one of the set of matched elements.
    Html(): Get the html contents (innerHTML) of the first matched element.

    1. Report
  4. Question:Which methods are used to add content before and inside of every matched element? 

    Answer
    before(content) method is used to add content before each of the matched element.
    appendTo(Seloctor) method is used to inside append all of the matched elements to another, seicified set of element.

    1. Report
  5. Question:What is the function of serializeArray() method? 

    Answer
    serializeArray() method is a useful function for getting values of the form elements. This function turns all the elements into a JavaScript object.  Given example below….
     Var data = $(‘form:first’).serializeArray();

    1. Report
  6. Question:Write the differences between load and get methods. 

    Answer
    Both methods are similar expect for the fact that $(selector).load() is a method, which means it acts on a set  of elements specified by a selector, On the other hand $.get() is global method that has an explicity defined callback function.

    1. Report
  7. Question:What is the purpose of using ajaxError() method? 

    Answer
    The ajaxError() method  will be execute every time there is an error in AJAX request. 
     Example given below:
    $("#result").ajaxError(function()
    {      
    $(this).html("<span>An error occurred.</span>");
    })

    1. Report
  8. Question:Which requests are cached by the browser? 

    Answer
    jQuery.ajax(): Perform an asynchronous HTTP (Ajax) request.jQuery.getScript(): Load a JavaScript file from the server using a GET HTTP request, then execute it.

    1. Report
  9. Question:What is jQuery selector? 

    Answer
    A JQuery selector is  a function which makes use of expressions to find out matching elements from a DOM based on the given criteria.

    1. Report
  10. Question:Write examples for bind and unbind events for any element. 

    Answer
    Bind():Attach a handler to an event for the elements.Unbind():Remove a previously-attached event handler from the elements.

    1. Report
Copyright © 2024. Powered by Intellect Software Ltd