In jquery, cdn means content distribution network, which is the abbreviation of "Content Delivery Network". It can place a copy server with good performance and smooth connection in the nearest place, at the fastest speed. Obtain content, that is, reference the jquery library of other websites, thereby greatly improving the loading speed of the page.
The operating environment of this tutorial: windows10 system, jquery3.2.1 version, Dell G3 computer.
What is cdn in jquery
CDN, the full name is Content Delivery Network, which is "content distribution network".
CDN, to put it simply, is to place a copy server with good performance and smooth connection closest to you, so that you can obtain content at the shortest distance and at the fastest speed. .
jQuery CDN refers to jQuery libraries that reference other websites. This method can greatly improve the page loading speed and reduce the waste of traffic on your website.
So what exactly is CDN? Let's look at a simple example first.
For the two computers in Figure 1, if you want to access the server, you need to go through multiple nodes. Computer 1 has two access lines: "Computer 1→A→B→C→Server" and "Computer 1→A→B→D→Server". Computer 2 has two access lines: "Computer 2→B→D→Server" and "Computer 2→B→C→Server".
Access route without CDN
Every time the computer accesses the server, it needs to go through multiple nodes, and the access speed will definitely be much slower. Then friends will ask: "Can we make the computer not need to go through extra nodes, but directly access the server?" The answer is definitely yes.
We can make the server into two copies, and then place the two copies closer to the user, as shown in Figure 2.
There is a CDN access route
So when we want to access the server, we only need to access the copy of the server. This method can greatly improve the access speed and reduce the waste of traffic. CDN, to put it simply, is to place a replica server with good performance and smooth connection closest to you, so that you can obtain content at the fastest speed at the nearest distance.
It takes a lot of money to deploy a replica server, but we can use the CDN route provided by a third party.
For jQuery CDN, the commonly used route is as follows:
//jQuery官网 <script src="http://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"> </script> //bootCDN <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
Simply speaking, as long as we introduce the above code, we do not need to introduce the local jQuery library. Please see the example below.
Example:
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script> <script> $(function () { $("div").css("color","red"); }) </script> </head> <body> <div>虽然长得丑,但是想得美。</div> </body> </html>
Output result:
Video tutorial recommendation: jQuery video tutorial
The above is the detailed content of What does cdn mean in jquery. For more information, please follow other related articles on the PHP Chinese website!

Classesarebetterforaccessibilityinwebdevelopment.1)Classescanbeappliedtomultipleelements,ensuringconsistentstylesandbehaviors,whichaidsuserswithdisabilities.2)TheyfacilitatetheuseofARIAattributesacrossgroupsofelements,enhancinguserexperience.3)Classe

Classselectorsarereusableformultipleelements,whileIDselectorsareuniqueandusedonceperpage.1)Classes,denotedbyaperiod(.),areidealforstylingmultipleelementslikebuttons.2)IDs,denotedbyahash(#),areperfectforuniqueelementslikeanavigationmenu.3)IDshavehighe

In CSS style, the class selector or ID selector should be selected according to the project requirements: 1) The class selector is suitable for reuse and is suitable for the same style of multiple elements; 2) The ID selector is suitable for unique elements and has higher priority, but should be used with caution to avoid maintenance difficulties.

HTML5hasseverallimitationsincludinglackofsupportforadvancedgraphics,basicformvalidation,cross-browsercompatibilityissues,performanceimpacts,andsecurityconcerns.1)Forcomplexgraphics,HTML5'scanvasisinsufficient,requiringlibrarieslikeWebGLorThree.js.2)I

Yes,onestylecanhavemoreprioritythananotherinCSSduetospecificityandthecascade.1)Specificityactsasascoringsystemwheremorespecificselectorshavehigherpriority.2)Thecascadedeterminesstyleapplicationorder,withlaterrulesoverridingearlieronesofequalspecifici

ThesignificantgoalsofHTML5aretoenhancemultimediasupport,ensurehumanreadability,maintainconsistencyacrossdevices,andensurebackwardcompatibility.1)HTML5improvesmultimediawithnativeelementslikeand.2)ItusessemanticelementsforbetterreadabilityandSEO.3)Its

React'slimitationsinclude:1)asteeplearningcurveduetoitsvastecosystem,2)SEOchallengeswithclient-siderendering,3)potentialperformanceissuesinlargeapplications,4)complexstatemanagementasappsgrow,and5)theneedtokeepupwithitsrapidevolution.Thesefactorsshou

Reactischallengingforbeginnersduetoitssteeplearningcurveandparadigmshifttocomponent-basedarchitecture.1)Startwithofficialdocumentationforasolidfoundation.2)UnderstandJSXandhowtoembedJavaScriptwithinit.3)Learntousefunctionalcomponentswithhooksforstate


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.
