Book Image

jQuery Essentials

By : Troy Miles
Book Image

jQuery Essentials

By: Troy Miles

Overview of this book

<p>JQuery is still the most popular JavaScript library. It is used in over 60% of the top websites on the Internet. It was written to make DOM manipulation (so, moving things around a web page) easier for developers. It acts through JavaScript to ascribe HTML elements to the DOM attributes. Because it is a library of predefined functions, all you need to start using jQuery is a working knowledge of the syntax and a reference for the functions available to you.</p> <p>This practical guide shows you how to make the most of jQuery to boost the performance of your websites and applications. We start off with a quick glance through the basics of JQuery, followed by the explanation of JQuery selectors, filters, and DOM element manipulation. After this, you will learn how events and animations can be used to create and design beautiful and user-friendly sites. Next, you will be familiarized with Ajax functions to help you send and receive data from your server. Finally, we’ll walk you through using built-in plugins and eventually create your own plugins for your websites.</p> <p>By the end of this book, you will be able to to build robust and efficient websites successfully using JQuery.</p>
Table of Contents (17 chapters)
jQuery Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Installing plugins


You have found a plugin or two that you like, so now what? Installing a plugin via npm is also easy but first you need to make sure that you have a package.json file located in the root of your application. This is a JSON file that is required by npm. If you don't have a package.json file, npm will not install your plugin. The following is an example of a rather minimalistic package.json file:

{
  "name": "plugins",
  "version": "1.0.0",
  "description": "A demo of using and writing plugins",
  "repository": "none",
  "license": "MIT",
  "dependencies": {
    "tipso": "^1.0.6"
  }
}

Please note that it is a JSON file and not a JavaScript object. The first field is the name of the application. Name is a required field; without it, npm will not install a package. If you are creating a plugin and plan to upload it to npm, the name must be unique.

The second field is the version number of the application. It is also required. The value placed here is very important when you...