We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8824c2e + 5564855 commit 36888c2Copy full SHA for 36888c2
lib/transports/polling-jsonp.js
@@ -132,7 +132,12 @@ JSONPPolling.prototype.doPoll = function () {
132
};
133
134
var insertAt = document.getElementsByTagName('script')[0];
135
- insertAt.parentNode.insertBefore(script, insertAt);
+ if (insertAt) {
136
+ insertAt.parentNode.insertBefore(script, insertAt);
137
+ }
138
+ else {
139
+ (document.head || document.body).appendChild(script);
140
141
this.script = script;
142
143
var isUAgecko = 'undefined' != typeof navigator && /gecko/i.test(navigator.userAgent);
0 commit comments