0

I am using a template in an ASP.NET MVC project. Template is here - http://themeforest.net/item/lagu-admin-premium-template/687301

All seems to be working apart from the tabs script. This works in the plain html version but in my MVC project it doesn't work.

This is the script at the end of the page

<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>

When I view source the correct location is there for the lagu.js file but the lga_flowTabs function doesn't appear to be working.

The html version is exactly the same but without the 'Content' folder.

Is there anyway I can debug this and figure out why the function isn't being hit in the MVC app?

Thanks

3
  • 2
    What does your browser's Javascript debugger/console window say? Commented Sep 10, 2012 at 16:32
  • 2
    Can you provide any kind of error message or anything? Commented Sep 10, 2012 at 16:34
  • Generally, jQuery.js has to be included in your head section as a real tag. It doesn't like being at the end of the file. Commented Sep 10, 2012 at 18:18

1 Answer 1

1

Maybe you can try this, if the file using this code is a cshtml (Assuming you're using Razor on MVC3 project)

<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>

Also, maybe silly question but, shouldn't your scripts be on the Scripts folder instead of Content?

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.