Getting a: Error: ReferenceError: $ is not defined
when I publish my website.
Even though I have the JQuery lib added in the Layout page, and now also on the partialView that complains about not finding the JQuery lib
This is how I reference it:
<script src="~/Scripts/jquery-1.10.2.min.js"></script>
When I run the website locally, it works fine, no JS errors, but it is as soon as it is published, that it starts complaining. Normally I would add code with my question, but I am not really sure what code to add. I just want to know if there is a difference in how the js files are loaded when site is published, than when running locally. Has anyone experienced such errors?
On 2nd thoughts, I'll try add code anyway. The code that complains is this: (And it is in a partialview)
<script type="text/javascript">
$(document).ready(function () {
$('#slider').rhinoslider();
$("#sliderHolderQitoz").toggle("fade", 6000);
});
</script>
My layout looks like this:
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
<script src="~/Scripts/jquery-1.10.2.min.js"></script>
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<link href="~/Content/rhinoslider-1.05.css" rel="stylesheet" />
<link href="~/Scripts/jquery-ui.min.css" rel="stylesheet" />
<script src="~/Scripts/jquery-ui.min.js"></script>
<script src="~/Scripts/jquery.unobtrusive-ajax.js"></script>
<script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
<script src="~/Scripts/OwnedScripts/InitializeUI.js"></script>
<script src="~/Scripts/OwnedScripts/Dialogs.js"></script>
<script src="~/Scripts/OwnedScripts/Misc.js"></script>
<script src="~/Scripts/ExtraScripts/rhinoslider-1.05.min.js"></script>
<script src="~/Scripts/ExtraScripts/rhinoslider-1.05.js"></script>
<script src="~/Scripts/ExtraScripts/mousewheel.js"></script>
<script src="~/Scripts/ExtraScripts/easing.js"></script>
Again, when running/debuggin locally, all is good, the error comes after publishing