Skip to main content

Bug Tracker

Side navigation

#15145 closed bug (notabug)

Opened June 13, 2014 06:15PM UTC

Closed June 13, 2014 06:56PM UTC

img tag with empty src, prop('src') returns URL of page

Reported by: Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.11.1
Keywords: Cc:
Blocked by: Blocking:

<img src>

attr('src') returns empty string

prop('src') returns the URL of the page

Attachments (0)
Change History (3)

Changed June 13, 2014 06:40PM UTC by dmethvin comment:1

owner: →
status: newpending

Corrected for the incorrect selector syntax and a bare-property output added:

It seems to be reflecting the src attribute to the src property correctly using the process described in

What value were you expecting for .prop(), and why?

Changed June 13, 2014 06:51PM UTC by comment:2

status: pendingnew

I was writing a little routine to reload images in the event they fail to load, by setting img src back to itself.

I guess I was expecting prop('src') to return null.

Changed June 13, 2014 06:56PM UTC by dmethvin comment:3

resolution: → notabug
status: newclosed

Definitely check those expectations against the standard. Most of the time reflected properties return an empty string rather than a null or undefined when the attribute is missing but we're not going to do something counter to the spec.