Ticket #6437 (closed bug: invalid)
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
Change History
Changed 3 years ago by twenzel
-
attachment
debugger_callstep1.png
added
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?
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:
- open IE8
- enter follwing url: http://rpv2.test.exsportance.de/en/Index/Index/test
- type "test" in username and password field
- hit login
- the error occurs on line 4954 in jquery.cs
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: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.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Debugger call step 1