1

Following is from cshtml in a ASP.Net MVC 4 View

I have a meta tag

  <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 

I have a Render script

@Scripts.Render("~/Scripts/UpdateHeader.js")
<script src="@Url.Content("~/Scripts/jquery-1.10.2.js")" type="text/javascript"></script>

But it is rendering as:

<script src="/Scripts/UpdateHeader.js"></script>
<script src="/Scripts/jquery-1.10.2.js" type="text/javascript"></script>

The type is missing:

type="text/javascript"

What is the best way to include type along with @Scripts.Render ?

0

1 Answer 1

1

In HTML5 the type attribute is not necessary.

But if you still need it (if perhaps you are targeting older browsers), then this answer should help you: https://stackoverflow.com/a/15663014/606602

Sign up to request clarification or add additional context in comments.

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.