开发者

MVC Master Page more than one JavaScript file include

开发者 https://www.devze.com 2023-02-06 16:34 出处:网络
So I have a master page in MVC that has the following code in its Master Page\'s head section: <head runat=\"server\">

So I have a master page in MVC that has the following code in its Master Page's head section:

<head runat="server">
    <title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>
    <link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/jquery-ui-1.8.9.custom.css" rel="stylesheet" type="text/css" />
    &l开发者_如何学JAVAt;link href="../../Content/ui.jqgrid.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/jquery-1.4.4.js" type="text/javascript" />
    <script src="../../Scripts/grid.locale-en.js" type="text/javascript" />
    <script src="../../Scripts/jquery.jqGrid.min.js" type="text/javascript" />
</head>

You can see that the last three files are the JavaScript files.

Now if I run this code, my jquery-1.4.4.js is included, but grid.locale-en.js and jquery.jqGrid.min.js which are in the same folder as jquery-1.4.4.js are not! What's up with this?? Is MVC being dumb and can't reference my last two javascript files as it did with the first one? The interesting thing is that, if I comment out the include with jquery-1.4.4.js, MVC will reference grid.locale-en.js which is the second line. So it seems that MVC is able to only reference the first include line of the javascript which ever one it is, but not any line after that. Can someone please explain this scenario?


You need to close the script tag off like this

<script src="..." type="text/javascript"></script>
0

精彩评论

暂无评论...
验证码 换一张
取 消