سؤال

I just decided to give JuiceUI a try, in order to take advantage of the quick and easy dialog popup. I tried to add the sample code for the dialog control to a page in my ASP.NET application (I just copied and pasted it from the Juice UI sample page for the dialog control) and got this runtime error:

Microsoft JScript runtime error: 'datepicker._attachDatepicker' is null or not an object

at line 138 in juice.js

Commented out all the lines of code in juice.js referencing .datepicker, and got

Microsoft JScript runtime error: 'ui.tabs' is null or not an object

commented this out and got the same for ui.dialogs and so on. It looks as though none of the controls are being instantiated. I must be missing some step, but I'm pretty new to this library and to jQuery as well for that matter, so I'm not sure what's going on. For context, I have JuiceUI 1.0.1, installed using the NuGet package manager.

I checked the binary reference in my web applicaiton project, and the reference in web.config and all seem to be as they should.

Has anyone else encountered this problem or have any ideas? Thanks in advance.

هل كانت مفيدة؟

المحلول

Answering my own question here. Problem was a stupid javascript rookie mistake. I forgot that the ordering of the references within the page is important. Previously, I had the script references as so:

<script src="../../Scripts/amplify.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.8.24.min.js" type="text/javascript"></script>
<script src="../../Scripts/juice.min.js" type="text/javascript"></script>

This wouldn't work because amplify has a dependency on jquery, so it couldn't be defined first. The problem goes away by reordering them as ...

<script src="../../Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.8.24.min.js" type="text/javascript"></script>
<script src="../../Scripts/amplify.min.js" type="text/javascript"></script>
<script src="../../Scripts/juice.min.js" type="text/javascript"></script>

Compilers have me spoiled.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top