document.addEventListener('DOMContentLoaded', function(){
VK.init({
apiId: MY_ID
});
},false);
не думаю. Это должно работать и такне думайте
var XHR = ("onload" in new XMLHttpRequest())?XMLHttpRequest:XDomainRequest;
var xhr = new XHR();
xhr.open('GET', 'https://www.google.com/search?q=%D1%8F%D0%B2%D0%B0%D1%84%D1%8B%D0%B2%D0%B0', true);
xhr.onload = function(){
if(this.status&&this.readyState){
var res=this.responseText.replace(/\n/g,'');
var res1=/[а-я].*(?=<\/a>)/gi.exec(res);
console.log(res1);
}
};
xhr.send();
var XHR = ("onload" in new XMLHttpRequest()) ? XMLHttpRequest : XDomainRequest;
var xhr = new XHR();
xhr.open('GET', 'https://www.google.com/search?q=%D1%8F%D0%B2%D0%B0%D1%84%D1%8B%D0%B2%D0%B0', true);
xhr.onload = function(){
if(this.status&&this.readyState){
var res=this.responseText.replace(/\r|\n/g,'');
var res1=/(?<=<h3 class=\"r\"><a .*\">)(.*?)(?=<\/a>)/gi.exec(res);
console.log(res1);
}
}
xhr.onerror = function() {
alert( 'Ошибка ' + this.status );
}
xhr.send();