2

When I load the page I can't show errors but when I use the inspector in Google Chrome I have this error:

Uncaught SyntaxError: Unexpected end of input

File: :65200/js/metro.min.js:1

And the first line of metro.min.js is all of this:

var METRO_AUTO_REINIT, METRO_LOCALE, METRO_WEEK_START, METRO_DIALOG = !1;
(function (c) {
    c.Metro = function (a) {
        c.extend({}, a)
    };
    c.Metro.getDeviceSize = function () {
        return {
            width: 0 < window.innerWidth ? window.innerWidth : screen.width,
            height: 0 < window.innerHeight ? window.innerHeight : screen.height
        }
    }
})(jQuery);
$(function () {
    $("html").on("click", function (c) {
        $(".dropdown-menu").each(function (a, b) {
            $(b).hasClass("keep-open") || "block" != $(b).css("display") || $(b).hide()
        })
    })
});

The .cshtml file have this:

<link href="~/css/metro-bootstrap.css" rel="stylesheet" type="text/css" />
<link href="~/css/metro-bootstrap-responsive.css" rel="stylesheet" type="text/css" />
<link href="~/css/iconFont.min.css" rel="stylesheet" type="text/css" />
<link href="~/css/custom.css" rel="stylesheet" type="text/css" />

And:

<script src="~/Scripts/jquery-2.1.0.min.js"></script>
<script src="~/Scripts/jquery-2.1.0.js"></script>
<script src="~/Scripts/jquery-ui-1.10.4.js"></script>
<script src="~/Scripts/jquery-ui-1.10.4.min.js"></script>
<script src="~/Scripts/modernizr-2.7.2.js"></script>
<script src="~/js/metro.min.js"></script>

Why can this be happening?

I'm using this bootstrap css: http://metroui.org.ua/

And I installed from here with Package Manager Console:

https://www.nuget.org/packages/Metro.UI.CSS/

1
  • 2
    why do you have both jquery's included? Take only the minified version sames goes for UI... Commented Apr 14, 2014 at 9:33

2 Answers 2

1

That error usually means you have unclosed } brackets ... though they seem ok in the fragment you have supplied though there may be some missing ; e.g.

$(function () {
    $("html").on("click", function (c) {
        $(".dropdown-menu").each(function (a, b) {
            $(b).hasClass("keep-open") || "block" != $(b).css("display") || $(b).hide()
        }); // here
    }); // here
});
Sign up to request clarification or add additional context in comments.

3 Comments

There are some links in geektnt.com/… that may help you find where the missing } bracket is - likely lower down in your code.
When I add the }); appear the error: Uncaught SyntaxError: Unexpected token )
1

You have included both jquery-2.1.0.js and jquery-2.1.0.min.js. Either one you can use at a Time.

Same for jquery-ui-1.10.4.js and jquery-ui-1.10.4.min.js either one you can use it here also.

Remove Min.Js both of the places and use .Js version jquery for Run time. While doing deployment include min.js and remove .js file.

If you use both of the files you will get continuously Uncaught SyntaxError exceptions. Only Include Below Lines under your Script:

<script src="~/Scripts/jquery-2.1.0.js"></script>
<script src="~/Scripts/jquery-ui-1.10.4.js"></script>
<script src="~/Scripts/modernizr-2.7.2.js"></script>
<script src="~/js/metro.min.js"></script>

And also follow the another answer of Ruskin your function is missing colons at the end of the function.

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.