I have just seen the following in my book Programming in HTML5 with javascript and css3:
<script ref="/file.js"></script>
I have never seen the ref attribute tag before in the script tag, is this valid?
Edit:
It is a typo in the book found http://www.oreilly.com/catalog/errata.csp?isbn=0790145371133
2 Answers 2
Negative, ref is not a permitted attribute as per: http://www.w3.org/TR/html-markup/script.html
The script element enables dynamic script and data blocks to be included in documents. Permitted attributes: global attributes & src & defer & async & type & charset & language.
via w3
Note, "referencing" files in <script /> tags must be done via the src method, which specifies the address of the external script to use.
I think the author meant to use src as below:
<script src="/file.js"></script>
Comments
It's a typo. The most likely candidate is the src attribute.
See https://developer.mozilla.org/en/docs/Web/HTML/Element/script