Book Image

Mastering JavaScript Promises

Book Image

Mastering JavaScript Promises

Overview of this book

Table of Contents (16 chapters)
Mastering JavaScript Promises
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

How to use jQuery


As we saw in Chapter 7, Promises in Angular.js, the documents related to Angular.js was the JavaScript file that was linked in HTML pages to call the functions; the same structure is used in jQuery.

jQuery is a JavaScript file that was linked in at the very beginning of our HTML file. This can be done in two ways: either call the file from its location on the Web or download the JavaScript file on your local hard drive and then embed the code. Either way it will work, but we prefer to use it from our hard drive.

The following lines of code show when we want to link a file from its remote location:

<head>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.min.js"></script>
</head>

Or, we can download the file on our local hard drive and change the syntax like this:

<head>
<script src="js/jQuery/jquery-1.9.min.js"></script>
</head>

Here, src="js is indicating the local folder where JavaScript file exists.

In a nutshell,...