foolip/microdatajs — pull request #3 by cimbul (2014-06-23 15:11:33+00:00)
Title: Create <a> instead of <img> when resolving URL properties

The `resolve()` function, which resolves potentially-relative URL properties against the page's base URL, currently creates an `` element with a `src` attribute set to the URL to be resolved. When the element is inserted into the document, the browser tries to fetch an image at that URL. This is at best an annoyance, and potentially harmful.

Instead, we can use an `` element. The caveat, detailed in [this StackOverflow question](http://stackoverflow.com/q/470832/250798), is that setting the `href` property directly doesn't trigger resolution in old versions of IE. There are several good workarounds on that page; I chose [this one](http://stackoverflow.com/a/22918332/250798).

I've tested this change in IE 7-11 and current versions of Firefox, Chrome, and Safari.