How to add jquery to an html css and javascript project

Asked
Active3 hr before
Viewed126 times

7 Answers

projectjavascriptjquery
90%

5,2

Example_snippet/controller/utility/_project.js/ 1 2 3 4 5 6 7 8 9 10 . . .
 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
load more v
88%

Using jQuery’s Default Theme for Style Enhancement,The jQuery library is now included in the jqproject project, and referenced from our index,html file

Example_snippet/controller/utility/_project.js/ <html> <head> <title>*jQ. . .
<html>

<head>
   <title>*jQuery Test Project*</title>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   *<style type="text/css">

   </style>*
</head>

<body>
   TODO write content
</body>

</html>
load more v
72%

Above action will save the jQuery library js file in a local folder, you can save it to any folder( for example the project lib folder like below picture), ,Above source code will include jQuery lib js which is saved in your local machine, it is not an optimized way because the jQuery link will read the jQuery source file from your web server for each request, this will cost a lot of bandwidth usage and computer resource

Example_snippet/controller/utility/_project.js/ <script type="text/javascript". . .
<script type="text/javascript" src="./lib/jquery-3.3.1.min.js"></script>
load more v
65%

Example_snippet/controller/utility/_javascript.js/ Google CDN: <script src="http. . .
Google CDN:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
75%

Finally, use the below syntax to include jQuery in the HTML file, i

Example_snippet/controller/utility/_javascript.js/ <script type="text/javascript". . .
<script type="text/javascript" src="jquery-3.5.1.min.js"> </script>
40%

If you include jQuery in this way, you'll include the following script in your HTML:,Reference it in your HTML as follows:,First, you need to include jQuery in your web projects, There are two different formats in which jQuery is available: development and production formats

Example_snippet/controller/utility/_javascript.js/ <script src="folder_name/jquer. . .
<script src="folder_name/jquery-1.12.0.js"></script>
load more v
22%

The jQuery library is a single JavaScript file, and you reference it with the HTML <script> tag (notice that the <script> tag should be inside the <head> section):,Tip: Place the downloaded file in the same directory as the pages where you wish to use it, ,Development version - this is for testing and development (uncompressed and readable code),If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:

Example_snippet/controller/utility/_javascript.js/ <script>. . .
<script>
load more v