Instance Method


Constructs a URL given an attribute string.


func url(withAttributeString string: String!) -> URL!



The HTML attribute string to convert.

Return Value

An NSURL object containing an absolute URL derived from the specified attribute string.


This method constructs a URL given the string value of an element attribute. Examples include the href attribute of a DOMHTMLAnchorElement object, or the src attribute of a DOMHTMLImageElement object. This method only applies to attributes that refer to URLs.

This method is similar to URLWithString: in the NSURL class, except that URLWithAttributeString: handles relative URLs automatically based on the current document’s location.