I am using .Net 4.0 freamworok on Visual Studio 2012. My web site I first started my website gives the following error on internet explorer 10. Other browsers(Google Chrome, Firefox..) is working correctly.
JavaScript critical error at line 2, column 1 in .........
SCRIPT1002: Syntax error
My jquery script file have set in Master page.
<head runat="server">
<script src="<%# ResolveUrl("~/") %>Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
I could not figure out the problem. Can you help me?
The complete text of the SCRIPT1002 message provides a clue, namely, Syntax error script section:
JavaScript critical error at line x, column y in siteZ.domainQ/mypage SCRIPT1002: Syntax error script section
For me, my _Layout.cshtml or Index.cshtml, had references to virtual paths that did not exist for scripts or styles.
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Bubble</title>
@Styles.Render("~/Content/ErrorPathDoesNotExist/css")
</head>
Or
@section Scripts{
@Scripts.Render("~/bundles/ErrorPathDoesNotExist")
}
I solved my error by removing or correcting the invalid virtual paths in the @Styles.Render or @Scripts.Render statements.
Please refer to Microsoft documentation about bundling, minification, and optimization for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With