What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-24 08:03:10
js check if image url exists
// create an XHR object const xhr = new XMLHttpRequest(); // listen for `onload` event xhr.onload = () => { if (xhr.status == 200) { console.log('Image exists.'); } else { console.log('Image does not exist.'); } }; // crea... Add solution -
Javascript 2021-10-07 23:56:04
download audio file javascript
var filename = url.substring(url.lastIndexOf("/") + 1).split("?")[0]; var xhr = new XMLHttpRequest(); xhr.responseType = 'blob'; xhr.onload = function() { var a = document.createElement('a'); a.href = window.URL.createObj... Add solution