Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#9351 closed bug (worksforme)

$('img[src$=.png]') error on IE7 and IE8

Reported by: [email protected] Owned by: [email protected]
Priority: undecided Milestone: 1.next
Component: selector Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:

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 (7)

comment:2 Changed 10 years ago by Rick Waldron

Component: unfiledselector
Owner: set to [email protected]
Status: newpending

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 10 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

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 10 years ago by anonymous

Quoting works.

Updated fiddle showing how to solve it: http://jsfiddle.net/Thinkscape/QmE3d/2/

comment:5 Changed 10 years ago by addyosmani

Resolution: invalid
Status: closedreopened

comment:6 Changed 10 years ago by addyosmani

Resolution: worksforme
Status: reopenedclosed

Updating status to worksforme as quoting appears to work fine here in both general and as per the submitters test case.

comment:7 Changed 8 years ago by anonymous

#codeErrormsg img[src$=right.png]

Note: See TracTickets for help on using tickets.