Bug Tracker

Opened 12 years ago

Closed 12 years ago

#7710 closed bug (invalid)

find with argument false doesn't work

Reported by: [email protected] Owned by:
Priority: undecided Milestone: 1.6
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:


There is a bug in the newest version. here is a sample code so u know what happens:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>Untitled Document</title>
		<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
		<script type="text/javascript">
			$(document).ready(function() {
		<ul id="test"></ul>

It will try to use the replace function on false which is not possible. Tested in IE8, Chrome and Firefox. Always the same bug. "Uncaught TypeError: Object false has no method 'replace'"

Change History (1)

comment:1 Changed 12 years ago by jitter

Resolution: invalid
Status: newclosed

Thanks for taking the time to contribute to the jQuery project by writing a bug report.

I checked your report and made a live test case out of it too. What you reported is not a bug in jQuery. Your usage of find() is completely invalid. The .find(selector) documentation says:

selector A string containing a selector expression to match elements against

false clearly is neither a string nor a valid selector thus you can't expect jQuery to do anything useful with an input like this one. The fact that jQuery didn't throw an error on this in earlier versions is purely coincidental. So this is a bug in your application logic which needs to get fixed.

Last edited 12 years ago by jitter (previous) (diff)
Note: See TracTickets for help on using tickets.