function getCount(str, i, counter = 0) {
if (i >= str.length) return counter;
if (['a', 'e', 'i', 'o', 'u'].indexOf(str[i]) != -1) {
return getCount(str, ++i, ++counter)
}
return getCount(str, ++i, counter);
}
var el = document.querySelector('.my-el');
el.remove();
el = null;
var el = document.querySelector('.my-el');
el.remove();
function adBlockNotDetected() {
var s = document.createElement('script');
s.async = 1;
s.src = "//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js";
document.head.appendChild(s);
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-1339685915169539",
enable_page_level_ads: true
});
}
preview(params) {
return new Promise((resolve) => {
this.axios
.post('/api/images/preview', params, {
responseType: 'blob'
})
.then(response => {
console.log('Картинка загружена');
var reader = new window.FileReader();
reader.readAsDataURL(response.data);
reader.onload = function() {
this.$refs.cropper.replace(reader.result);
console.log('Картинка готова')
resolve();
}.bind(this)
})
});
}
transport: 'beacon'
при отправке события document.querySelector('.body').classList.add("test2");
var elements = document.getElementsByClassName("body");
for (var i = 0; i < elements.length; i++) {
elements[i].classList.add("test2");
}