0

My Anytime date picker widget is not working. Here's my reference at Site Master:

<link href="Content/anytime/anytime.5.1.2.min.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/anytime/anytime.5.1.2.min.js"></script>
    <script src="Scripts/anytime/jquery-1.11.0.min.js"></script>
    <%--<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
    <script src="//www.ama3.com/anytime/anytime.5.1.2.js"></script>--%>

css is working fine, but the jquery and anytime.js doesn't. As you can see I have two lines commented, those two lines work pretty well if the source is directly to their web page, but if I reference it in my local it just doesn't work, no calendar nor time picker pops up.

Anyone who knows what i'm doing wrong?

cracker_chan
  • 93
  • 1
  • 3
  • 11

2 Answers2

0

Order of loading of scripts is important when there are dependencies such as a plugin that is dependent on jQuery.js.

The dependency must load first so switch the order of your loading:

<script src="Scripts/anytime/jquery-1.11.0.min.js"></script>
<script src="Scripts/anytime/anytime.5.1.2.min.js"></script>

You should be seeing errors thrown in browser dev tools console like $ is undefined due to improper order

charlietfl
  • 170,828
  • 13
  • 121
  • 150
0

I just made it to work. I tried referencing it to the page where it was called upon and I noticed a difference in the "src".

<script type="text/javascript" src="../../Scripts/anytime/jquery-1.11.0.min.js" ></script>
<script type="text/javascript" src="../../Scripts/anytime/anytime.5.1.2.min.js" ></script>

whereas if I reference it in the Site.Master, those dots doesn't exist when you click the "Pick URL". I tried pasting it back to the Site.Master with the dots and it works.

cracker_chan
  • 93
  • 1
  • 3
  • 11