Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var data;
- function getFileContents(filePath, callbackFn, scope) {
- var xhr = new XMLHttpRequest();
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4) {
- callbackFn.call(scope, xhr.responseText);
- data="hello";
- }
- }
- xhr.open("GET", chrome.extension.getURL(filePath), true);
- xhr.send();
- }
- alert(data);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement