Skip to content

Commit f77fa04

Browse files
author
Jason Moon
committed
Merge pull request #28 from SparkSoftware/master
Adds AMD Support for use with RequireJS
2 parents 7aca0d4 + 8fc4a29 commit f77fa04

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

jQuery.XDomainRequest.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
// jQuery.XDomainRequest.js
22
// Author: Jason Moon - @JSONMOON
33
// IE8+
4-
(function($){
4+
(function (factory) {
5+
if (typeof define === 'function' && define.amd) {
6+
// AMD. Register as anonymous module.
7+
define(['jquery'], factory);
8+
} else {
9+
// Browser globals.
10+
factory(jQuery);
11+
}
12+
}(function ($) {
513

614
if (!$.support.cors && $.ajaxTransport && window.XDomainRequest) {
715
var httpRegEx = /^https?:\/\//i;
@@ -91,4 +99,4 @@ if (!$.support.cors && $.ajaxTransport && window.XDomainRequest) {
9199
});
92100
}
93101

94-
})(jQuery);
102+
}));

0 commit comments

Comments
 (0)