If I make a simple html file i get it to work by using the same jquery reference. But this does not work in my asp.net core app.
I don't understand why. Is it razor?
here is the shared layout: Before asking: I've tried putting these scripts in the lower part of the page too and that didn't work either. I've also tried to put the function call
to the datepicker into the view instead with no success.
<script src="https://code.jquery.com/jquery-1.12.4.js"></script><script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<!DOCTYPE html><html lang="no"><head><!-- Required meta tags --><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><environment names="Development"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous"><link rel="stylesheet" href="https://use.fontawesome.com/f1c723715a.css"><link href='https://fonts.googleapis.com/css?family=Muli:400,300' rel='stylesheet' type='text/css'><link href="~/css/materialDesign.css" rel="stylesheet" /><link href="~/css/jquery-ui.min.css" rel="stylesheet" /><script src="https://code.jquery.com/jquery-1.12.4.js"></script><script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script><script>$(function () {$("#datepicker").datepicker(); });</script></environment><environment names="Staging,Production"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous" asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css" asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" /><link rel="stylesheet" href="https://use.fontawesome.com/f1c723715a.css"/><link href='https://fonts.googleapis.com/css?family=Muli:400,300' rel='stylesheet' type='text/css'/><link rel="stylesheet" href="~/css/materialDesign.min.css" asp-append-version="true" /></environment></head><body><div class="container"><p></p> @RenderBody()<p></p><hr /><footer><p>© 2017 - Styreforum</p></footer></div><!-- jQuery first, then Tether, then Bootstrap JS. --><script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script><script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script><script src="~/js/stuff.js"></script> @RenderSection("Scripts", required: false)</body></html>
here is the view:
<p>Date: <input type="text" id="datepicker"></p>
What can be wrong here? the refrences are right. Are there crashes with the other scripts? I can't get validation to work either.