Ticket #9351 (closed bug: worksforme)
$('img[src$=.png]') error on IE7 and IE8
| Reported by: | abodera@… | Owned by: | abodera@… |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.next |
| Component: | selector | Version: | 1.6.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
This only happens on IE7 and IE8. Not tested on IE9. Works ok on safari,chrome, FF4.
Object doesn't support this property or method
in jquery-1.6.1.js, line 998 character 15
Does NOT occur on jquery-1.4.2.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/js/jquery/jquery-1.6.1.js"></script>
<script type="text/javascript">
//<![CDATA[
$(function(){
$('img[src$=png]'); // this works ok
$('img[src$=.png]'); // this will crash
});
//]]>
</script>
</head>
<body>
<img src="whatever.png" alt="" />
</body>
</html>
Change History
comment:2 Changed 2 years ago by rwaldron
- Owner set to abodera@…
- Status changed from new to pending
- Component changed from unfiled to selector
Take a look at the api, there have been some changes made in the last 6 months or so regarding attribute selectors, most notably that jQuery requires quotes around the attribute value of the selector http://api.jquery.com/attribute-equals-selector/
comment:3 Changed 2 years ago by trac-o-bot
- Status changed from pending to closed
- Resolution set to invalid
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
comment:4 Changed 2 years ago by anonymous
Quoting works.
Updated fiddle showing how to solve it: http://jsfiddle.net/Thinkscape/QmE3d/2/
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Test under IE7 or IE8: http://jsfiddle.net/QmE3d/1/