开发者

Using SquishIt to combine js files has no effect?

开发者 https://www.devze.com 2023-04-12 11:12 出处:网络
@{ ViewBag.Title = \"Home Page\"; SquishIt.JavaScript.Add( Url.Content(\"~/Scripts/jquery_ui.js\"), Url.Content(\"~/Scripts/jquery_1.4.4.js\")
@{
  ViewBag.Title = "Home Page";
  SquishIt.JavaScript.Add(
    Url.Content("~/Scripts/jquery_ui.js"),
    Url.Content("~/Scripts/jquery_1.4.4.js")
  );
}
@SquishIt.JavaScript.Render(Url.Content("~/Scripts/min.js"))

It shows like this:

<script type="text/javascript" src="/Scripts/jquery_ui.js"></script>`
<script type="text/javascript" src="/Scripts/jquery_1.4.4.js">&l开发者_开发百科t;/script>`

Where is "min.js"?

The two js files are not combine into one js named min.js?

Thanks!


To help with debugging, SquishIt does not do anything to the files when in debug mode.

However, you can add a .ForceRelease() call before the .Render(...) call to force it to combine the files as if it's in release mode:

@SquishIt.JavaScript.ForceRelease().Render(Url.Content("~/Scripts/min.js"))


Do you have debug="true" in web.config? It must be set to "false" for squishit to work: http://www.codethinked.com/squishit-the-friendly-aspnet-javascript-and-css-squisher

0

精彩评论

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

关注公众号