6 examples of 'jquery cdnjs' in JavaScript

Every line of 'jquery cdnjs' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
5function createDynamicCdnObject(moduleName, version, globalVarName, url) {
6 return {
7 name: moduleName,
8 var: globalVarName,
9 url,
10 version
11 };
12}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

17function loadjQuery(url, callback) {
18 var script_tag = document.createElement('script');
19 script_tag.setAttribute("src", url)
20 script_tag.onload = callback; // Run callback once jQuery has loaded
21 script_tag.onreadystatechange = function () { // Same thing but for IE... bad for IE 10, it supports all
22 if (this.readyState == 'complete' || this.readyState == 'loaded') {callback();}
23 }
24 script_tag.onerror = function() {
25 loadjQuery("http://code.jquery.com/jquery-1.8.2.min.js", main);
26 }
27 document.getElementsByTagName("head")[0].appendChild(script_tag);
28}
34function cdnImage (url, width) {
35 return 'https://images1-focus-opensocial.googleusercontent.com/gadgets/proxy?url=' + url + '&container=focus&refresh=2592000&resize_w=' + width
36}
24function loadJQuery() {
25 if(!window.jQuery) {// load only if its required as it is giving problem on many pages.
26 addLibrary("/thirdparty/pratikabu-jquery.js", function(result) {
27 eval(result);
28 pratikabusttjquery = window.jQuery.noConflict(true);// this line will replace any existing mapping of $ and jQuery on the current page
29 loadCompleteFile();
30 });
31 } else {
32 pratikabusttjquery = window.jQuery;
33 loadCompleteFile();
34 }
35}
20function notcdnjs(url){
21 return url.indexOf(baseURL) != 0 || exceptions.some(function(item){
22 return url.indexOf(baseURL + item) == 0;
23 });
24}
51function getCdnUrl(url) {
52 return '//mib.bdstatic.com/doc/detail/' + encodeURIComponent(url) + '/0/#from=sub';
53}

Related snippets