5 examples of 'download jquery min js' in JavaScript

Every line of 'download jquery min js' 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
120function download(url) {
121 torrents[url] = true;
122 // If the torrent already exists, kick off the downloads of the files, as this
123 // won't happen naturally when the torrent is added (because it already exists!)
124 if(btapp.has('torrent')) {
125 if(btapp.get('torrent').each(function(torrent) {
126 if(torrent.has('properties')) {
127 if(torrent.get('properties').get('download_url') === url) {
128 download_torrent_files(torrent.get('properties'));
129 return;
130 }
131 }
132 }));
133 }
134}
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

200function downloadCSS(a, style) {
201
202 var options = $minify.prop("checked") ? {compress: true} : {};
203
204 $.less.getCSS(style.less, $.extend(options, {id: style.name, variables: style.variables})).done(function(css) {
205
206 if (style.fonts) {
207 css = style.fonts + "\n" + css;
208 }
209
210 if ($rtl) {
211 css = $.rtl.convert2RTL(css);
212 }
213
214 css = css.replace(/http(.+?)\/fonts\/?/g, function(){
215 return "../fonts/";
216 });
217
218 if ($download) {
219 a.attr("href", $url.createObjectURL(new Blob([css], {type: "application/force-download"})));
220 } else {
221 $("h2", $modal).text("CSS Code");
222 $("textarea", $modal).val(css);
223 }
224 });
225}
16function download(url: string, filename: string) {
17 console.log(`download ${url}...`)
18 return new Promise<void>((resolve) => {
19 request(url, resolve).pipe(fs.createWriteStream(filename))
20 });
21}
14function download(url, w, progress = () => {}) {
15 return new Promise((resolve, reject) => {
16 let protocol = /^https:/.exec(url) ? https : http
17 progress(0)
18 protocol
19 .get(url, res1 => {
20 protocol = /^https:/.exec(res1.headers.location) ? https : http
21 protocol
22 .get(res1.headers.location, res2 => {
23 const total = parseInt(res2.headers['content-length'], 10)
24 let completed = 0
25 res2.pipe(w)
26 res2.on('data', data => {
27 completed += data.length
28 progress(completed / total)
29 })
30 res2.on('progress', progress)
31 res2.on('error', reject)
32 res2.on('end', () => resolve(w.path))
33 })
34 .on('error', reject)
35 })
36 .on('error', reject)
37 })
38}
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}

Related snippets