Bug Tracker

Modify

Ticket #6437 (closed bug: invalid)

Opened 3 years ago

Last modified 14 months ago

AJAX IE error "Object doesn't support this property or method"

Reported by: twenzel Owned by:
Priority: undecided Milestone:
Component: ajax Version: 1.4.3
Keywords: Cc:
Blocking: Blocked by:

Description

It's a weird bug. The most time I call a ajax method I recieve following error "Object doesn't support this property or method". jquery.js Line 4954 Char 5

After a page refresh sometime it works sometime it doesnt.

I've attached a screenshort of the ie8 script debugger. The code works fine on FF and Chrome.

Do you have any suggestions?

Attachments

debugger_callstep1.png Download (102.1 KB) - added by twenzel 3 years ago.
Debugger call step 1
debugger_callstep2.png Download (121.2 KB) - added by twenzel 3 years ago.
Debugger call step 2
debugger_callstep4.png Download (114.7 KB) - added by twenzel 3 years ago.
Debugger call step 4
debugger_callstep5.png Download (127.4 KB) - added by twenzel 3 years ago.
Debugger call step 5
debugger_callstep3.png Download (112.7 KB) - added by twenzel 3 years ago.
Debugger call step 3
error.png Download (66.6 KB) - added by twenzel 3 years ago.
ie8 error dialog

Change History

Changed 3 years ago by twenzel

Debugger call step 1

Changed 3 years ago by twenzel

Debugger call step 2

Changed 3 years ago by twenzel

Debugger call step 4

Changed 3 years ago by twenzel

Debugger call step 5

Changed 3 years ago by twenzel

Debugger call step 3

comment:1 Changed 3 years ago by dmethvin

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

Screen shots don't make it easy to reproduce the problem. Since it's not clear this is a jQuery bug, can you start on the forums?

 http://forum.jquery.com

comment:2 Changed 3 years ago by twenzel

  • Status changed from closed to reopened
  • Resolution invalid deleted

Here are the steps to reproduce the problem:

Changed 3 years ago by twenzel

ie8 error dialog

comment:3 Changed 3 years ago by pserru

2010-04-26 . I have the same problem with MSIE (6.0.2900.5512.xpsp.080413-2111 [sp3]) with jQuery 1.4.2. I Added some code before the fatal "$.ajax() call: ... if (typeof($.ajax)!=='undefined') { ... alert("F1b_root.js(88): L'objet '$.ajax' EST DÉFINI. (Type: "+typeof($.ajax)+")."); ... and the text "...(Type: function)." appears in the alert window before the "property or method..." message displayed by IE(Sorry, the real message is in spanish!). Under Windows, no problem with firefox 3.6.3. Dont normaly use MSW/MSIE, so I checked/tryed the security settings, but nothing fund. Using Windows for test purpose only.

comment:4 Changed 3 years ago by pserru

After a look on the way to turn around, it works fine. So, some buggy condition(s) found by IE in the code previously executed could place it silently in a state it can display this "Object doesn't support this property or method" message. Then: the solution for the user is to check his code until this display disapears... and good luck! Patrick

comment:5 Changed 3 years ago by pserru

The problem was probably coming from an attempt to share the main page jQuery code from an IFRAME (all using the same domain anyway)... Everything was working well (with shared jQuery) until the insertion of the ajax call in the iframe page code. This could help users (and jQuery developpers ?)... I hope that this is the final post in that thread :-)

comment:6 Changed 3 years ago by pserru

Back... By my side, the status of this ticket should be changed. My problem was:

Opera said:

Error: \ name: TypeError \ message: Statement on line 447: Type mismatch (usually non-object value supplied where object required)

Window IE said:

line: 496 \ car: 4 \ error: this object does not accept...(in spanish) \

The faulty line(s) in source file were: line 447 (or 496)=« $.get("F0ax.php", », following line: « { AxIn: "ints:"+lang+":"+Fi_0.phpQ.ReqText.toSource() }, » then « function(msg) { »

The advanced developpers should immediatly see (if I was able to format this post properly) that the problem was not line 448 nor line 497, column 4. I needed days to find it :-/.

But why does M$ give a character number in the faulty line if this information is not reliable??? Both browser saying that the faulty line was the previous one. Note that I thougt to this possibility, and that's why the instruction is on more than one line!

I take the risk to appear ridiculous, but this last post could help other newbies. Please, excuse me (and Microsoft)...

comment:7 Changed 3 years ago by twenzel

I solved my problem. It's a weired IE bug. I'v created a IE issue:  https://connect.microsoft.com/IE/feedback/details/553766

Short description: A ajax call fails when the html page is declared as UTF-8 (<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />) and no HTTP charset header ('Content-type: text/html; charset=utf-8') is provided.

comment:8 Changed 3 years ago by Bradley

Possibly related to #6298 ?

comment:9 Changed 3 years ago by addyosmani

  • Priority set to undecided
  • Status changed from reopened to closed
  • Resolution set to invalid

Having reviewed the discussion on this particular ticket, it would appear that it has been confirmed as a bug in IE8.0, but not the jQuery core.

Further evaluation of the existence of this bug is not possible at this time as neither the Microsoft feedback link provided is valid any longer nor is the username/password on the site provided as a demonstration.

Closing.

comment:10 Changed 3 years ago by daflip <jerry.walsh@…>

This is still happening for me and it seems quite a lot of others too. I'm using IE8.

The HTML document needs a XHTML doctype in order to reproduce this bug. My document also has a utf-8 charset defined in a meta tag and i do NOT have a http charset header being sent (sending it doesn't fix the problem). The problem is present in 1.4.2 and 1.4.3 (i just tested the lattrr today).

The following code, lifted from here:  http://www.sikosoft.com/item/jquery_object_doesnt_support_this_property_or_method_142_-_solution

"fixes" the problem:

$(function () {

$.ajaxSetup({

xhr: function() {

if ($.browser.msie) {

return new ActiveXObject("Microsoft.XMLHTTP");

} else {

return new XMLHttpRequest();

}

}

})

})

comment:11 Changed 3 years ago by daflip <jerry.walsh@…>

ergghh... here's the "fix" properly formatted:

$(function () {
  $.ajaxSetup({ 
    xhr: function() {
      if ($.browser.msie) {
        return new ActiveXObject("Microsoft.XMLHTTP");
      } else {
        return new XMLHttpRequest();
      }
    }
  })
})



comment:12 Changed 3 years ago by Rwhitbeck

  • Status changed from closed to reopened
  • Version changed from 1.4.2 to 1.4.3
  • Resolution invalid deleted
  • Milestone 1.4.3 deleted

In light of the new information that daflip posted can we reevaluate this problem?

comment:13 Changed 3 years ago by anonymous

I'm getting the same error at a different location, line 100 character 300 in the 1.4.3 minimized version.

Adding the above ajaxSetup hack does nothing but reverting to 1.4.2 makes the error go away.

comment:14 Changed 2 years ago by snover

  • Status changed from reopened to closed
  • Resolution set to invalid

We need a reproducible, reduced test case in order to evaluate this issue. So far, after 7 months, we do not have one. If anyone can actually provide one (using  jsFiddle), then we can reopen and reevaluate this issue.

Last edited 2 years ago by snover (previous) (diff)

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.