2

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

3

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>
Sign up to request clarification or add additional context in comments.

Comments

1

It's a typo. The most likely candidate is the src attribute.

See https://developer.mozilla.org/en/docs/Web/HTML/Element/script

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.