10 examples of 'get url jquery' in JavaScript

Every line of 'get url jquery' 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
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}
64function _getLoadUrl(code) {
65 return this.contextPath + 'workflow/flow/define/viewxml/'+ code +'/000';
66}
42function __carrotware_SetJQueryURL(jqPath) {
43 jqURL = jqPath;
44
45 __carrotware_LoadJQuery();
46}
111function getScriptUrl(script) {
112 var url = script.src;
113 if (url) {
114 // Normalize package: urls
115 var index = url.indexOf('packages/');
116 if (index == 0 || (index > 0 && url[index - 1] == '/')) {
117 url = "package:" + url.slice(index + 9);
118 }
119 return url;
120 } else {
121 // TODO(sigmund): investigate how to eliminate the warning in Dartium
122 // (changing to text/javascript hides the warning, but seems wrong).
123 return "data:application/dart;base64," + window.btoa(script.textContent);
124 }
125}
106function getScriptUrl(prefix, scriptName) {
107 return prefix + scriptName;
108}
64function getJsCode(url) {
65 return unescape(url.substr(11));
66}
3function ajaxGet(url, callback) {
4 var req = new XMLHttpRequest();
5 req.open("GET", url);
6 req.addEventListener("load", function () {
7 if (req.status >= 200 && req.status < 400) {
8 // Appelle la fonction callback en lui passant la réponse de la requête
9 callback(req.responseText);
10 } else {
11 console.error(req.status + " " + req.statusText + " " + url);
12 }
13 });
14 req.addEventListener("error", function () {
15 console.error("Erreur réseau avec l'URL " + url);
16 });
17 req.send(null);
18}
6function getURL(url, onLoad) {
7 const xmlhttp = new XMLHttpRequest();
8
9 if (!url) {
10 onLoad(null);
11 return;
12 }
13
14 xmlhttp.onreadystatechange = () => {
15 if (xmlhttp.readyState === requestDone) {
16 if (xmlhttp.status === 200) {
17 let data = null;
18 try {
19 data = JSON.parse(xmlhttp.responseText);
20 } catch (e) {
21 // eslint-disable-next-line
22 console.log('Loading', url,
23 'Expecting JSON, instead got', xmlhttp.responseText);
24 }
25 onLoad(data);
26 } else {
27 // eslint-disable-next-line
28 console.log('Loading', url, 'expected 200, got', xmlhttp.status, xmlhttp.responseText);
29 }
30 }
31 };
32 xmlhttp.open('GET', url, true);
33 xmlhttp.send();
34}
313function _jQueryPost(url, postdata, onsuccess)
314{
315 jQuery.ajax(url, {
316 'type': 'POST',
317 'data': postdata,
318 'dataType': 'json',
319 'success': onsuccess,
320 'error': onAjaxError
321 });
322};
7export function getUrl(url) {
8 return config.base + url;
9}

Related snippets