Bug Tracker

Opened 13 years ago

Closed 12 years ago

Last modified 11 years ago

#5006 closed bug (worksforme)

$('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 'http://www.google.com', 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

Change History (5)

comment:1 Changed 13 years ago by cwolves

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...

comment:2 Changed 13 years ago by jerone

Do you've got a testcase?

comment:3 Changed 13 years ago by dmethvin

Component: unfiledselector

comment:4 Changed 12 years ago by addyosmani

Keywords: iframe src added
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 http://jsfiddle.net/addyosmani/BKZVG/2/ but you shouldn't be querying with [src=] if you're specifically looking for those elements with an empty-string src attribute.

comment:5 Changed 12 years ago by anonymous

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

Note: See TracTickets for help on using tickets.