70 likes | 135 Views
jquery is library written in javascript to ease your javascript code. jQuery greatly simplifies JavaScript programming along with easy-to-use API that works across a multitude of browsers which saves time which you would spend on bunch of complicated codes of javascript, like ajax calls,dom manipulation,each loops,etc.
E N D
Basics jQuery is library written in java script to ease your java script code. jQuery greatly simplifies JavaScript programming along with easy-to-use API that works across a multitude of browsers which saves time which you would spend on bunch of complicated codes of javascript, like ajax calls,dom manipulation, each loops,etc. Basic syntax is: $(selector).action() Examples: $(this).hide() - hides the current element. $("p").hide() - hides all elements.
jQuery Selectors jQuery selectors are one of the most important parts of the jQuery library. jQuery selectors allow you to select and manipulate HTML element(s). jQuery selectors are used to "find" (or select) HTML elements based on their name, id, classes, types, attributes, values of attributes and much more. All selectors in jQuery start with the dollar sign and parentheses: $(). Example When a user clicks on a button, all elements will be hidden: $(document).ready(function(){ $("button").click(function(){ $("p").hide(); }); });
Advantages Easy to use For ex. • Normal java script: document.getElementById("myBtn").addEventListener("click",function() { alert("Hello World!"); }); • Jquery: $("#myBtn").click(function() { alert("Hello World!"); }); • This is how JQuery reduces your effort of writing long javascript code and saves your time.
Works across multiple browsers i.e. work on cross browser Uses simple and powerful syntax Highly extensible Ajax support Commands can be “chained” so that the result of one command can then control others. Has a “built-in” set of animation applications that can also be used as commands.
Disadvantages 1.No out-of-the-box features to support development: For larger and more complicated applications you will need to extend way beyond core with additional libraries and plug-ins. With several large libraries, you add size and dependencies, which will slow down your application and create future difficulties in debugging. 2.Not built for larger apps: At its core, jQuery is a DOM manipulation library. While a lot of other platforms include it, you’ll need more than just jQuery to develop a complex app.
Thank You Visit:- http://www.havsolutions.com/jquery-for-beginners/