Skip to main content

Bug Tracker

Side navigation

#5006 closed bug (worksforme)

Opened August 04, 2009 12:19AM UTC

Closed October 28, 2010 04:25AM UTC

Last modified March 13, 2012 06:24PM UTC

$('iframe').attr('src') != $('iframe')[0].src

Reported by: cwolves Owned by:
Priority: major Milestone: 1.4
Component: selector Version: 1.3.2
Keywords: iframe src Cc:
Blocked by: Blocking:

Somewhat a weird bug, but if the src is '', one has a trailing slash, the other doesn't...

Worse, if the src is blank, src="", one has the src set to the parent root and the other doesn't (firefox)

The specific issue that I'm running into is this:

<iframe src="">

$('iframe').filter('[src=]') // no results

FF 3.5.2

Attachments (0)
Change History (5)

Changed August 04, 2009 12:24AM UTC by cwolves comment:1

Oh, the reason I referenced the DOM object is that .filter and .find seem to be getting results based on the DOM value whereas .attr('src') seems to be doing something else...

Changed August 08, 2009 02:56PM UTC by jerone comment:2

Do you've got a testcase?

Changed June 13, 2010 02:27PM UTC by dmethvin comment:3

component: unfiledselector

Changed October 28, 2010 04:25AM UTC by addyosmani comment:4

keywords: → iframe src
resolution: → worksforme
status: newclosed

For the two cases submitted, ie $('iframe').attr('src') != $('iframe')[0].src, these are both working fine in jQuery 1.4.3 as demonstrated here Live Test Case. This also demonstrates filter working fine when filtering by the src attribute. In addition, src="" will work fine as per here but you shouldn't be querying with [src=] if you're specifically looking for those elements with an empty-string src attribute.

Changed October 28, 2010 04:43AM UTC by anonymous comment:5

This isn't fixed...

In your test case, one method has a trailing slash, the other doesn't. Also, please see the test case for empty src's:

I'm not sure what the correct behavior should be here, nor do I care any longer (15 month old ticket), but it's not fixed :)

MacOS Chrome & FF