0

我在 ASP.NET MVC 项目中使用模板。模板在这里 - http://themeforest.net/item/lagu-admin-premium-template/687301

除了标签脚本之外,一切似乎都在工作。这适用于纯 html 版本,但在我的 MVC 项目中它不起作用。

这是页面末尾的脚本

<script type="text/javascript">  
        head.js(
            "/Content/js/jquery-1.6.2.min.js",
            "/Content/lib/jquery-ui/jquery-ui-1.8.15.custom.min.js",
            "/Content/lib/harvesthq-chosen/chosen.jquery.min.js",
            "/Content/lib/fusion-charts/FusionCharts.js",
            "/Content/lib/fancybox/jquery.easing-1.3.pack.js",
            "/Content/lib/fancybox/jquery.fancybox-1.3.4.pack.js",
            "/Content/lib/file-uploader/fileuploader.js",
            "/Content/lib/tiny-mce/jquery.tinymce.js",
            "/Content/js/jquery.microaccordion.js",
            "/Content/js/jquery.tools.min.js",
            "/Content/js/jquery.stickyPanel.js",
            "/Content/js/xbreadcrumbs.js",
            "/Content/lib/jquery-validation/jquery.validate.js",
            "/Content/js/lagu.js",
            function(){
                lga_fusionCharts.chart_k();
                lga_wizard.init();
                lga_flowTabs.tabs_b();
                lga_selectBox.init();
                lga_datepicker.init();
                lga_editor.init();
                lga_sticky.sticky_contentActions();
                lga_clearForm.init();
                lga_form_a_validation.init();
            }
        )
    </script>

当我查看源代码时,lagu.js 文件的正确位置在那里,但 lga_flowTabs 函数似乎不起作用。

html 版本完全相同,但没有“内容”文件夹。

无论如何我可以调试它并找出为什么该功能没有在 MVC 应用程序中被击中?

谢谢

4

1 回答 1

1

如果使用此代码的文件是 cshtml(假设您在 MVC3 项目上使用 Razor),也许您可​​以试试这个

<script type="text/javascript">  
        head.js(
            "@Url.Content("~/Content/js/jquery-1.6.2.min.js")",
            "@Url.Content("/Content/lib/jquery-ui/jquery-ui-1.8.15.custom.min.js")",
            "@Url.Content("/Content/lib/harvesthq-chosen/chosen.jquery.min.js")",
            "@Url.Content("/Content/lib/fusion-charts/FusionCharts.js")",
            "@Url.Content("/Content/lib/fancybox/jquery.easing-1.3.pack.js")",
            "@Url.Content("/Content/lib/fancybox/jquery.fancybox-1.3.4.pack.js")",
            "@Url.Content("/Content/lib/file-uploader/fileuploader.js")",
            "@Url.Content("/Content/lib/tiny-mce/jquery.tinymce.js")",
            "@Url.Content("/Content/js/jquery.microaccordion.js")",
            "@Url.Content("/Content/js/jquery.tools.min.js")",
            "@Url.Content("/Content/js/jquery.stickyPanel.js")",
            "@Url.Content("/Content/js/xbreadcrumbs.js")",
            "@Url.Content("/Content/lib/jquery-validation/jquery.validate.js")",
            "@Url.Content("/Content/js/lagu.js")",
            function(){
                lga_fusionCharts.chart_k();
                lga_wizard.init();
                lga_flowTabs.tabs_b();
                lga_selectBox.init();
                lga_datepicker.init();
                lga_editor.init();
                lga_sticky.sticky_contentActions();
                lga_clearForm.init();
                lga_form_a_validation.init();
            }
        )
    </script>

另外,也许是个愚蠢的问题,但是,您的脚本不应该在Scripts文件夹上而不是Content?

于 2012-09-10T19:29:08.770 回答