I am reading through the XHTML 1.0 Strict Doctype and found out that there's a value of "script"
for the rel
attribute on the link
element.
<link rel="script" href="..." />
I tried using this tag to link external JS files, but Safari does not even load the file. So what can the tag be used for?
Update:
After rereading the DTD, it doesn't exactly list out valid values for the rel
attribute. The 'script'
value appears only as an example on a comment. Thus, this may or may not be implemented in all browser.
The link
element is there to convey relationship information between the page being viewed and the content of the element.
From the spec:
Although LINK has no content, it conveys relationship information that may be rendered by user agents in a variety of ways
So, informational only.
There is not only a "script" value, "rel" can contain any valid attribute content. The questions are:
Obviously, the W3C wanted scripts to be includable like stylesheets (<link rel="Stylesheets" …>
), but did not mention it in the prosa sections of the spec, only in the DTD comments. You find it in the HTML 4.01 strict DTD as well (XHTML 1.0 is just a reformulation of HTML 4.01 in XML). Strangely, it is neither not mentioned in the corresponding link type section nor in the script section. It could be an artifact of an idea which was rejected later.
This brings us to the answer to question 2. It is not properly implemented in browsers, at least in Safari (you mentioned it yourself). Therefore, you should not use it, because it will not work cross-browser. You can use it as a hack (to include scripts which will not be loaded by Safari), but this is not safe, because you cannot tell if a later version of Safari changes the behaviour.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With