Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- debugging chrome extension
- ...
- function init() {
- getdata();
- }
- var txt;
- function getdata() {
- var xhr = new XMLHttpRequest();
- xhr.open('GET',myurl, true);
- xhr.setRequestHeader('Cache-Control', 'no-cache');
- xhr.setRequestHeader('Pragma', 'no-cache');
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4) if (xhr.responseText) {
- txt = xhr.responseText;
- }
- }
- xhr.send();
- console.log(txt);
- }
- ...
- <body onload="init();">
- ...
Advertisement
Add Comment
Please, Sign In to add comment