joshreesjones
joshreesjones

Reputation: 1954

What does src="http" do?

Let's say I have a normal iframe with some standard attributes:

<iframe width="300" height="300" src="http"></iframe>

What will this src="http do? I've seen it around but I don't exactly know what http will point to or what this iframe will now fetch.

Upvotes: 0

Views: 132

Answers (3)

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201728

The attribute src="http" refers to a resource with the relative URL http. Relative URLs are resolved relative to the current base URL, which is by default the URL of the document itself but can be set with a base element.

Resolution of relative URLs is normatively specified in STD 66. For example, if the URL of the document http://www.example.com/foo/bar/fun.html and there is no base element, then the attribute src="http" is equivalent to src="http://www.example.com/foo/bar/http".

Upvotes: 2

Elliott Frisch
Elliott Frisch

Reputation: 201467

With a colon that specifies the protocol that the rest of the mandatory url (uniform resource location), hyper text transport protocol in this case. Other types of protocol include https, ftp, ftps, mailto and more. At one time, gopher was "popular".

Without a colon, e.g. as asked, @recursive is correct.

Upvotes: 0

recursive
recursive

Reputation: 86124

It will request a file called "http" relative to the current path.

Upvotes: 7

Related Questions