Skip to content

Commit b839f05

Browse files
committed
fix XMLHttpRequest in chrome is notdefined
1 parent aa8aa3c commit b839f05

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

github.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99
// Initial Setup
1010
// -------------
1111

12+
var XMLHttpRequest;
1213
if (typeof this.exports !== 'undefined') {
13-
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
14+
XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
1415
var _ = require('underscore');
16+
}else{
17+
XMLHttpRequest = window.XMLHttpRequest;
1518
}
1619

1720
var API_URL = 'https://api.github.com';

0 commit comments

Comments
 (0)