0

Could someone tell me why "in-line" attribute used inside the tag, For example:

<script inline type="text/javascript"></script>

Without this attribute, the JS does not load in the page

Jay Blanchard
34.5k17 gold badges82 silver badges130 bronze badges
asked Jun 17, 2015 at 15:54
5
  • 2
    Does that attribute even exist? starts rummaging through W3C specs Commented Jun 17, 2015 at 15:57
  • 2
    I have never used "inline" and my javascript files load without problems. Commented Jun 17, 2015 at 15:57
  • 1
    I guess the answer to your question would be: Because the author didn't know better. "Without this attribute, the JS does not load in the page" That's hard to believe. Are you using any special server side technology that could be responsible for the inline attribute? Commented Jun 17, 2015 at 16:00
  • Or JavaScript which looks for it? Commented Jun 17, 2015 at 16:25
  • You need to show a larger piece of code than that to back up your claim that the javascript doesn't load without ti. Commented Jun 18, 2015 at 18:20

1 Answer 1

2

The 'inline' property does not exist for the script tag.

MDN

Nor does it exist in the list of global attributes

When people say "inline javascript" they're talking about using script tags to put javascript on the page

<script>
 alert('hello world!!!');
</script>

Or just into an html tag

<a href="#" onclick="return false;">click here!</a>

as opposed to in a separate file.

<script src="script.js"></script>
answered Jun 17, 2015 at 15:59
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.