Reputation: 15
I'm completely new to programming in ASP.NET and any form of web application developement. I've tried looking for answer but couldn't find any related problems. Most probably it's simple begginers mistake, but I've run out of ideas what might be the cause. I'm using Visual Studio 2013 if that's relevant.
In the master page in head I've included:
<script src="@Url.Content("~/Scripts/custom.js")" type="text/javascript"></script>
In custom.js I've created function for testing purpouses, but it never triggers, like any other:
$(document).click(function () {
alert("Alert using jQuery");
});
What's most interesting js functions put in the custom.js file are working properly, but none of JQuery functions, even simplest one like above don't seem to be ever launched.
What confuses me most is that I've tried using online compilers and there it worked perfectly. Also Jquery 1.10.2 is included in project. Any ideas what might be the issue? Thanks for your time, lads!
Upvotes: 0
Views: 35
Reputation: 17064
You have not loaded the JQuery file. That's why you see $ is not defined
. That's also why the functions on the custom.js
file that are not using JQuery are working.
The same way you loaded the custom.js
file, you need to load the 1.10.2 JQuery file.
Upvotes: 1