Skip to content

Commit 31f22f2

Browse files
committed
jquery ajax: fixed jquery#2865 and jquery#2570. Not passing username to xml.open if it's null, or it open a login popup on some Opera's.
1 parent 5a92ec2 commit 31f22f2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ajax.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,11 @@ jQuery.extend({
276276
var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
277277

278278
// Open the socket
279-
xml.open(s.type, s.url, s.async, s.username, s.password);
279+
// Passing null username, generates a login popup on Opera (#2865)
280+
if( s.username )
281+
xml.open(s.type, s.url, s.async, s.username, s.password);
282+
else
283+
xml.open(s.type, s.url, s.async);
280284

281285
// Need an extra try/catch for cross domain requests in Firefox 3
282286
try {

0 commit comments

Comments
 (0)