{"id":25732,"date":"2020-03-31T06:00:00","date_gmt":"2020-03-31T11:00:00","guid":{"rendered":"https:\/\/www.hostgator.com\/blog\/?p=25732"},"modified":"2020-03-31T13:49:48","modified_gmt":"2020-03-31T18:49:48","slug":"why-you-should-only-load-jquery-from-google-libraries","status":"publish","type":"post","link":"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/","title":{"rendered":"Why You Should ONLY Load jQuery from Google Libraries"},"content":{"rendered":"\n<p>You probably already know that it&#8217;s better to load static files from a Content Distribution Network (CDN). JavaScript, CSS, and image files fall into this category. However, there&#8217;s another step beyond a CDN &#8211; hosted libraries. These hosted libraries are high speed, geographically distributed servers that serve as content distribution networks for popular, open source Javascript libraries. You can call on these well-known JavaScript libraries and add them to your site with a small bit of code.<\/p>\n\n\n\n<p>There are many well known hosted libraries &#8211; the two most famous being\u00a0<a href=\"https:\/\/developers.google.com\/speed\/libraries\">Google<\/a>\u00a0and\u00a0<a href=\"https:\/\/cdnjs.com\/\">CDNJS<\/a>. It might seem like a good idea to serve all your JavaScript files from these libraries, but that might not be a generally good idea. In this article, I&#8217;ll show you that the most important use-case for using them is jQuery. And that too ONLY from Google&#8217;s network.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Buy Hostgator Plans with an In-Built CDN<\/h2>\n\n\n\n<p>Both hosted libraries and CDNs share the same goals. They serve your content from servers located geographically close to users at very high speeds. But not all\u00a0<a href=\"https:\/\/www.hostgator.com\/web-hosting\">web hosting plans<\/a>\u00a0include a dedicated CDN. For example, Hostgator&#8217;s optimized WordPress packages use the SiteLock CDN network, but not the shared hosting plans, which rely on Cloudflare. Here&#8217;s the\u00a0<a href=\"https:\/\/www.wp-tweaks.com\/hostgator-coupon-code-list\/\">Hostgator coupon list<\/a>\u00a0to help you find the best deal!<\/p>\n\n\n\n<p>However, there are a few differences between hosted public libraries and traditional CDNs.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">DNS Resolution<\/h3>\n\n\n\n<p>Some CDNs like Cloudflare use a &#8220;reverse proxy&#8221; setup. What this means is that your static files will be served over your site&#8217;s URL like this: https:\/\/www.yoursite.com\/jquery.js, instead of this:  https:\/\/yoursite.somecdnnetwork.com\/jquery.js <\/p>\n\n\n\n<p>This has an important side effect. It means that for the first URL, the browser won&#8217;t have to perform an additional DNS lookup to retrieve the file jquery.js. The second URL however, is hosted on a different domain name compared to your own site, so there is an added lag while the browser gets the IP address for the new domain.<\/p>\n\n\n\n<p>Ideally, we want to reduce the number of DNS lookups as much as possible. Internal testing has convinced me that in most cases, the additional DNS lookup isn&#8217;t worth it. Therefore, I prefer CDNs that function on a reverse proxy model like Cloudflare instead of traditional networks that change the static file URLs.<\/p>\n\n\n\n<p>However, public libraries are&nbsp;<em>by definition<\/em>&nbsp;hosted on an external URL. Google&#8217;s URLs start with &#8220;ajax.googleapis.com&#8221; and CDNJS URLs are &#8220;cdnjs.cloudflare.com&#8221;. This means that unless the browser has already cached the response from another site, there will&nbsp;<em>always<\/em>&nbsp;be an additional DNS lookup. This makes public libraries very tricky to use, compared to reverse proxy CDNs, or just hosting the files on your own server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Globally Distributed Networks Comparison<\/h3>\n\n\n\n<p>Not all CDNs are built the same. While most try and do a fairly decent job of spreading out their servers across the globe, there are some locations that are chronically underserved. Africa is one glaring example. None of the well-known retail CDNs that I&#8217;ve tested, serve the African subcontinent well enough. They usually have just one location in Johannesburg and that&#8217;s it.<\/p>\n\n\n\n<p>However, publicly hosted libraries like Google and CDNJS have a much stronger network than most CDNs. CDNJS\u00a0<a href=\"https:\/\/blog.cloudflare.com\/an-update-on-cdnjs\/\">now uses Cloudflare&#8217;s network<\/a>, which means it has a very strong presence across the globe with multiple server locations for any given area.<\/p>\n\n\n\n<p>Bottom line: Large public JavaScript libraries are faster than ordinary CDN networks.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Not All JavaScript is Equally Important &#8211; jQuery is Unique<\/h2>\n\n\n\n<p>jQuery holds a distinguished position amongst JavaScript libraries. Currently, almost\u00a0<a href=\"https:\/\/w3techs.com\/technologies\/details\/js-jquery\/1\">75% of all websites use it<\/a>\u00a0as shown here:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/jqueryisunique-1024x614.jpg\" alt=\"example of how jquery is unique\" class=\"wp-image-25736\" width=\"580\" height=\"347\" srcset=\"https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/jqueryisunique-1024x614.jpg 1024w, https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/jqueryisunique-300x180.jpg 300w, https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/jqueryisunique-768x460.jpg 768w, https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/jqueryisunique.jpg 1396w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><\/figure>\n\n\n\n<p>It&#8217;s also quite large compared to the other external JavaScript files on your site. So if you had to choose one JavaScript library to speed up, it would undoubtedly by jQuery.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">jQuery is Usually Render-Blocking<\/h3>\n\n\n\n<p>I&#8217;d written earlier on the Hostgator blog about how to\u00a0<a href=\"https:\/\/www.hostgator.com\/blog\/7-ways-to-improve-your-site-speed-in-wordpress\/\">optimize your site for speed<\/a>. There we see that you should &#8220;defer&#8221; or &#8220;async&#8221; all your JavaScript so that it doesn&#8217;t block your site from rendering. Unfortunately, jQuery is referenced often by both external\u00a0<em>and<\/em>\u00a0inline scripts. This means that generally speaking, you should keep jQuery loaded in the header, and this slows down your page rendering.<\/p>\n\n\n\n<p>If you ignore my advice and load jQuery via &#8220;defer&#8221; or &#8220;async&#8221;, your site will break one day, and you won&#8217;t know why. Just trust me on this. I would love to defer the loading of jQuery, but it&#8217;s just too unstable to do so.<\/p>\n\n\n\n<p>For this reason, I want to use every means possible to speed up the delivery of jQuery. And for that, publicly hosted libraries are the best.<\/p>\n\n\n\n<p>This is true for two reasons.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Public Libraries Are Ideal for Browser Caching<\/h2>\n\n\n\n<p>Perhaps the biggest difference between a traditional CDN network and a public library, is that the former is accessed by only your website, and the latter is accessed by thousands &#8211; even millions &#8211; of people.<\/p>\n\n\n\n<p>Browsers typically cache the JavaScript they receive for differing periods of time &#8211; even up to a year! The idea is that if it sees the same URL again, it doesn&#8217;t&nbsp;<em>need<\/em>&nbsp;to download it again. It can simply use its cached copy and bypass the process entirely. This is the absolute best-case scenario for us. Ideally, the visitor&#8217;s browser will&nbsp;<em>already<\/em>&nbsp;have jQuery cached in its memory and thus solve our render-blocking problems in one go.<\/p>\n\n\n\n<p>But for this, we need to use well-known public libraries that everyone else is using. A private CDN will not bring the same caching and performance benefits. This is one huge advantage in favor of public hosted libraries.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The Same Goes for DNS Lookups<\/h3>\n\n\n\n<p>Browsers cache not just files, but also DNS lookups. So if millions of people are using a certain public library, the chances are that an average user will already have the DNS entry in their browser, and thus avoid the lookup altogether.<\/p>\n\n\n\n<p>This sidesteps the penalty of DNS lookups. But again &#8211; it will only work with a public hosted library where everyone uses the same URL. Not a traditional CDN.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Which Public Library is the Best?<\/h2>\n\n\n\n<p>To test this, I downloaded a simple program that probes the cached files in a variety of browsers. I searched for the two most well-known CDNs in today&#8217;s market &#8211; Google and CDNJS.<\/p>\n\n\n\n<p>Here are the results for Google&#8217;s library:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"603\" src=\"https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/Googlelibraryresults-1024x603.jpg\" alt=\"Google library\" class=\"wp-image-25737\" srcset=\"https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/Googlelibraryresults-1024x603.jpg 1024w, https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/Googlelibraryresults-300x177.jpg 300w, https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/Googlelibraryresults-768x452.jpg 768w, https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/Googlelibraryresults-1536x905.jpg 1536w, https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/Googlelibraryresults.jpg 1594w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>And here are the results for CDNJS:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"438\" src=\"https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/resultsCDNJSlibrary-1024x438.jpg\" alt=\"CDNJS library\" class=\"wp-image-25738\" srcset=\"https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/resultsCDNJSlibrary-1024x438.jpg 1024w, https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/resultsCDNJSlibrary-300x128.jpg 300w, https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/resultsCDNJSlibrary-768x329.jpg 768w, https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/resultsCDNJSlibrary.jpg 1446w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>As you can see, both Google and CDNJS files are cached in my browser from one site or the other. So from a DNS resolution point of view, both Google and CDNJS are on par. Both public libraries are likely to have been used, and they&#8217;re both spared the penalty of a DNS lookup.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">But Google Wins for jQuery<\/h3>\n\n\n\n<p>But look at the results more closely. Out of the two, you can see that CDNJS has only&nbsp;<em>one<\/em>&nbsp;version of jQuery cached &#8211; 2.2.4. Whereas Google&#8217;s library has 11 of them!&nbsp;So unless your website uses JavaScript version 2.2.4,&nbsp;the Google library will be far better for you than CDNJS.<\/p>\n\n\n\n<p>This is because for one reason or another, more people use Google&#8217;s libraries to download jQuery than any other file. I don&#8217;t know why this is the case, but that&#8217;s just the way it is.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">WordPress Doesn&#8217;t Use the Latest jQuery Version<\/h2>\n\n\n\n<p>At the time of this writing, WordPress still uses jQuery version 1.12.4. This is for compatibility, since a lot of plugins rely on the older versions and they don&#8217;t want to break them. Looking at the screenshots above, you can see that only Google&#8217;s library has served jQuery version 1.12.4. If I were to use CDNJS as my source, most browsers wouldn&#8217;t have it in their cache and would need to download it.<\/p>\n\n\n\n<p>So it&#8217;s not enough for a hosted library to serve jQuery. They need to be popular with a lot of different&nbsp;<em>versions<\/em>&nbsp;of jQuery, to maximize the chances that any particular version will be in a random browser&#8217;s cache.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using Google&#8217;s Library to Server jQuery on WordPress<\/h2>\n\n\n\n<p>The procedure will be different for each software framework. But if you want to use Google&#8217;s library for jQuery with WordPress, paste the following code into your theme&#8217;s functions.php file.<\/p>\n\n\n\n<p>function load_google_jquery () {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (is_admin()) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;global $wp_scripts;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (isset($wp_scripts-&gt;registered[&#8216;jquery&#8217;]-&gt;ver)) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$ver = $wp_scripts-&gt;registered[&#8216;jquery&#8217;]-&gt;ver;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ver = str_replace(&#8220;-wp&#8221;, &#8220;&#8221;, $ver);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$ver = &#8216;1.12.4&#8217;;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wp_deregister_script(&#8216;jquery&#8217;);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wp_register_script(&#8216;jquery&#8217;, &#8220;\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/$ver\/jquery.min.js&#8221;, false, $ver);<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>add_action(&#8216;init&#8217;, &#8216;load_google_jquery&#8217;);<\/p>\n\n\n\n<p>This code checks the version of jQuery that WordPress is using, and then constructs the URL for use with Google&#8217;s library.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Moral of the Story: Google is Best for jQuery<\/h2>\n\n\n\n<p>I have nothing against CDNJS. In fact, I prefer them from a philosophical point of view since they&#8217;re FOSS, and partner with Cloudflare &#8211; another company I like. But numbers are numbers, and technology doesn&#8217;t allow for sentimentality. In the contest for which library is better to serve jQuery, Google comes out head and shoulders above the competition. And as we&#8217;ve seen above, jQuery is the&nbsp;<em>one<\/em>&nbsp;JavaScript library that shouldn&#8217;t be deferred or asynced. And so using Google libraries is a no-brainer.<\/p>\n\n\n\n<p>For the remaining JavaScript files, it doesn&#8217;t matter that much since they don&#8217;t block your page. But pay special attention to jQuery &#8211; it can make or break your page speed times!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You probably already know that it&#8217;s better to load static files from a Content Distribution Network (CDN). JavaScript, CSS, and&#8230;<\/p>\n","protected":false},"author":206,"featured_media":25734,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[137,120,125],"class_list":["post-25732","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-and-hosting-tips","tag-hostgator-web-pros","tag-shared-hosting","tag-vps-hosting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v23.2 (Yoast SEO v23.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Why You Should ONLY Load jQuery from Google Libraries - HostGator<\/title>\n<meta name=\"description\" content=\"Which library should you use for jQuery commands? Check out this article on why you should rely on Google libraries over other choices.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Why You Should ONLY Load jQuery from Google Libraries\" \/>\n<meta property=\"og:description\" content=\"Which library should you use for jQuery commands? Check out this article on why you should rely on Google libraries over other choices.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/\" \/>\n<meta property=\"og:site_name\" content=\"HostGator\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/HostGator\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-31T11:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-03-31T18:49:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.hostgator.com\/blog\/wp-content\/\/uploads\/2020\/03\/Why-you-should-only-load-jquery-from-google-libraries.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1152\" \/>\n\t<meta property=\"og:image:height\" content=\"604\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Bhagwad\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@HostGator\" \/>\n<meta name=\"twitter:site\" content=\"@HostGator\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bhagwad\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/\"},\"author\":{\"name\":\"Bhagwad\",\"@id\":\"https:\/\/www.hostgator.com\/blog\/#\/schema\/person\/5b6b402dc17266a3e5e588d6e9f9d902\"},\"headline\":\"Why You Should ONLY Load jQuery from Google Libraries\",\"datePublished\":\"2020-03-31T11:00:00+00:00\",\"dateModified\":\"2020-03-31T18:49:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/\"},\"wordCount\":1763,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.hostgator.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/Why-you-should-only-load-jquery-from-google-libraries.jpg\",\"keywords\":[\"HostGator Web Pros\",\"Shared Hosting\",\"VPS Hosting\"],\"articleSection\":[\"Web Hosting Tips\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/\",\"url\":\"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/\",\"name\":\"Why You Should ONLY Load jQuery from Google Libraries - HostGator\",\"isPartOf\":{\"@id\":\"https:\/\/www.hostgator.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/Why-you-should-only-load-jquery-from-google-libraries.jpg\",\"datePublished\":\"2020-03-31T11:00:00+00:00\",\"dateModified\":\"2020-03-31T18:49:48+00:00\",\"description\":\"Which library should you use for jQuery commands? Check out this article on why you should rely on Google libraries over other choices.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/#primaryimage\",\"url\":\"https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/Why-you-should-only-load-jquery-from-google-libraries.jpg\",\"contentUrl\":\"https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/Why-you-should-only-load-jquery-from-google-libraries.jpg\",\"width\":1152,\"height\":604,\"caption\":\"why you should only load jquery from google libraries\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.hostgator.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Why You Should ONLY Load jQuery from Google Libraries\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.hostgator.com\/blog\/#website\",\"url\":\"https:\/\/www.hostgator.com\/blog\/\",\"name\":\"HostGtaor\",\"description\":\"Web Hosting and Marketing Tips for Entrepreneurs\",\"publisher\":{\"@id\":\"https:\/\/www.hostgator.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.hostgator.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.hostgator.com\/blog\/#organization\",\"name\":\"HostGtaor\",\"url\":\"https:\/\/www.hostgator.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.hostgator.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2019\/04\/cropped-HG-Logo_default-default.png\",\"contentUrl\":\"https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2019\/04\/cropped-HG-Logo_default-default.png\",\"width\":1092,\"height\":215,\"caption\":\"HostGtaor\"},\"image\":{\"@id\":\"https:\/\/www.hostgator.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/HostGator\",\"https:\/\/x.com\/HostGator\",\"https:\/\/www.instagram.com\/hostgator\",\"https:\/\/www.linkedin.com\/company\/hostgator-com\",\"https:\/\/www.pinterest.com\/hostgator\/\",\"https:\/\/www.youtube.com\/user\/hostgator\"],\"email\":\"support@gator.com\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.hostgator.com\/blog\/#\/schema\/person\/5b6b402dc17266a3e5e588d6e9f9d902\",\"name\":\"Bhagwad\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.hostgator.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3729556e740ae12d08e67c4f502e3962?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3729556e740ae12d08e67c4f502e3962?s=96&d=mm&r=g\",\"caption\":\"Bhagwad\"},\"description\":\"Bhagwad is a freelance writer and owner of the website WP-Tweaks. He's an expert on WordPress and web hosting and has been writing about them since 2009. He also likes to play the piano, and waste time with video games!\",\"url\":\"https:\/\/www.hostgator.com\/blog\/author\/bhagwad\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Why You Should ONLY Load jQuery from Google Libraries - HostGator","description":"Which library should you use for jQuery commands? Check out this article on why you should rely on Google libraries over other choices.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/","og_locale":"en_US","og_type":"article","og_title":"Why You Should ONLY Load jQuery from Google Libraries","og_description":"Which library should you use for jQuery commands? Check out this article on why you should rely on Google libraries over other choices.","og_url":"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/","og_site_name":"HostGator","article_publisher":"https:\/\/www.facebook.com\/HostGator","article_published_time":"2020-03-31T11:00:00+00:00","article_modified_time":"2020-03-31T18:49:48+00:00","og_image":[{"width":1152,"height":604,"url":"https:\/\/www.hostgator.com\/blog\/wp-content\/\/uploads\/2020\/03\/Why-you-should-only-load-jquery-from-google-libraries.jpg","type":"image\/jpeg"}],"author":"Bhagwad","twitter_card":"summary_large_image","twitter_creator":"@HostGator","twitter_site":"@HostGator","twitter_misc":{"Written by":"Bhagwad","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/#article","isPartOf":{"@id":"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/"},"author":{"name":"Bhagwad","@id":"https:\/\/www.hostgator.com\/blog\/#\/schema\/person\/5b6b402dc17266a3e5e588d6e9f9d902"},"headline":"Why You Should ONLY Load jQuery from Google Libraries","datePublished":"2020-03-31T11:00:00+00:00","dateModified":"2020-03-31T18:49:48+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/"},"wordCount":1763,"commentCount":0,"publisher":{"@id":"https:\/\/www.hostgator.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/#primaryimage"},"thumbnailUrl":"https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/Why-you-should-only-load-jquery-from-google-libraries.jpg","keywords":["HostGator Web Pros","Shared Hosting","VPS Hosting"],"articleSection":["Web Hosting Tips"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/","url":"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/","name":"Why You Should ONLY Load jQuery from Google Libraries - HostGator","isPartOf":{"@id":"https:\/\/www.hostgator.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/#primaryimage"},"image":{"@id":"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/#primaryimage"},"thumbnailUrl":"https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/Why-you-should-only-load-jquery-from-google-libraries.jpg","datePublished":"2020-03-31T11:00:00+00:00","dateModified":"2020-03-31T18:49:48+00:00","description":"Which library should you use for jQuery commands? Check out this article on why you should rely on Google libraries over other choices.","breadcrumb":{"@id":"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/#primaryimage","url":"https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/Why-you-should-only-load-jquery-from-google-libraries.jpg","contentUrl":"https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2020\/03\/Why-you-should-only-load-jquery-from-google-libraries.jpg","width":1152,"height":604,"caption":"why you should only load jquery from google libraries"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hostgator.com\/blog\/why-you-should-only-load-jquery-from-google-libraries\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hostgator.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Why You Should ONLY Load jQuery from Google Libraries"}]},{"@type":"WebSite","@id":"https:\/\/www.hostgator.com\/blog\/#website","url":"https:\/\/www.hostgator.com\/blog\/","name":"HostGtaor","description":"Web Hosting and Marketing Tips for Entrepreneurs","publisher":{"@id":"https:\/\/www.hostgator.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hostgator.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hostgator.com\/blog\/#organization","name":"HostGtaor","url":"https:\/\/www.hostgator.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hostgator.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2019\/04\/cropped-HG-Logo_default-default.png","contentUrl":"https:\/\/www.hostgator.com\/blog\/wp-content\/uploads\/2019\/04\/cropped-HG-Logo_default-default.png","width":1092,"height":215,"caption":"HostGtaor"},"image":{"@id":"https:\/\/www.hostgator.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/HostGator","https:\/\/x.com\/HostGator","https:\/\/www.instagram.com\/hostgator","https:\/\/www.linkedin.com\/company\/hostgator-com","https:\/\/www.pinterest.com\/hostgator\/","https:\/\/www.youtube.com\/user\/hostgator"],"email":"support@gator.com"},{"@type":"Person","@id":"https:\/\/www.hostgator.com\/blog\/#\/schema\/person\/5b6b402dc17266a3e5e588d6e9f9d902","name":"Bhagwad","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hostgator.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3729556e740ae12d08e67c4f502e3962?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3729556e740ae12d08e67c4f502e3962?s=96&d=mm&r=g","caption":"Bhagwad"},"description":"Bhagwad is a freelance writer and owner of the website WP-Tweaks. He's an expert on WordPress and web hosting and has been writing about them since 2009. He also likes to play the piano, and waste time with video games!","url":"https:\/\/www.hostgator.com\/blog\/author\/bhagwad\/"}]}},"_links":{"self":[{"href":"https:\/\/www.hostgator.com\/blog\/wp-json\/wp\/v2\/posts\/25732"}],"collection":[{"href":"https:\/\/www.hostgator.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostgator.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostgator.com\/blog\/wp-json\/wp\/v2\/users\/206"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostgator.com\/blog\/wp-json\/wp\/v2\/comments?post=25732"}],"version-history":[{"count":4,"href":"https:\/\/www.hostgator.com\/blog\/wp-json\/wp\/v2\/posts\/25732\/revisions"}],"predecessor-version":[{"id":25846,"href":"https:\/\/www.hostgator.com\/blog\/wp-json\/wp\/v2\/posts\/25732\/revisions\/25846"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostgator.com\/blog\/wp-json\/wp\/v2\/media\/25734"}],"wp:attachment":[{"href":"https:\/\/www.hostgator.com\/blog\/wp-json\/wp\/v2\/media?parent=25732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostgator.com\/blog\/wp-json\/wp\/v2\/categories?post=25732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostgator.com\/blog\/wp-json\/wp\/v2\/tags?post=25732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}