如何在ScriptBundle中使用noscript标记

时间:2015-04-29 16:10:23

标签: javascript c# asp.net-mvc

我在我的代码中使用了scriptBundle,就像这样

var ideaGaugesBundle = new ScriptBundle("~/Content/scripts/external/gauges/ideaGaugesBundle")
                .Include("~/Content/scripts/external/gauges/gauges.js")
                .Include("~/Content/scripts/external/gauges/raphael.js");
            ideaGaugesBundle.Orderer = nullOrderer;
            bundles.Add(ideaGaugesBundle);

它在@ Scripts.Render的页面上呈现(“〜/ Content / scripts / external / gauges / ideaGaugesBundle”)

        <script src="/Content/scripts/external/gauges/gauges.js"></script>
<script src="/Content/scripts/external/gauges/raphael.js"></script>

如何动态地为每个人添加noscript标签?

    <script src="/Content/scripts/external/gauges/gauges.js"></script>
<noscript>It appears that javascript is not supported or disabled.</noscript>
    <script src="/Content/scripts/external/gauges/raphael.js"></script>
<noscript>It appears that javascript is not supported or disabled.</noscript>

1 个答案:

答案 0 :(得分:0)

解决 问题是因为我在发布模式下处于调试模式,它们正在合并并像这样呈现

<script src="/Content/scripts/external/gauges/ideaGaugesBundle?v=aZoSAkEOJjHIoGeUE95SrTKdRXcx3_goCN4TVgrS9RY1"></script>