Bug Tracker

Modify

Ticket #2167 (closed bug: duplicate)

Opened 5 years ago

Last modified 5 years ago

Opera Mobile fails to initialize XMLHttpRequest

Reported by: paulu Owned by:
Priority: major Milestone: 1.2.3
Component: ajax Version: 1.2.2
Keywords: opera mobile, ajax Cc:
Blocking: Blocked by:

Description

Using the ajax features of jQuery on Opera Mobile 8.65 fails, since jQuery detects a window.ActiveXObject, tries to create an xmlhttp object using the ActiveXObject but fails. Apart from this, jQuery works fine on Opera Mobile.

Changing line 2638 in jquery 1.2.2 from

var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();

to

var xml = window.ActiveXObject && !jQuery.browser.opera ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();

fixes the problem for me. Output from the attached file in Opera Mobile before replacing the above line:

Test document


version: 8.65
safari: false
opera: true
msie: false
mozilla: false
window.ActiveXObject: [object PluginObject]

Output after replacing the line:

Test document


version: 8.65
safari: false
opera: true
msie: false
mozilla: false
window.ActiveXObject: [object PluginObject]


Test document

Attachments

opera_test.html Download (630 bytes) - added by paulu 5 years ago.

Change History

Changed 5 years ago by paulu

comment:1 Changed 5 years ago by cmcnulty

See #3087 for a better more flexible fix than the one provided here.

comment:2 Changed 5 years ago by flesler

  • Status changed from new to closed
  • Resolution set to duplicate

The XHR creation process is exposed since [5805] allowing overriding. You can add this code externally.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.