Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The problem appears to be your main function. You are loading jQuery UI and then calling jQuery(document).ready(). ready() will fire immediately because the DOM is already loaded. So you start loading jQuery UI and then immediately execute jQuery UI code before jQuery UI is loaded. You should pass your function with jQuery UI code into the success handler for getScript().</p> <pre><code>jQuery.getScript( url, [ success(data, textStatus) ] ) url - A string containing the URL to which the request is sent. success(data, textStatus) - A callback function that is executed if the request succeeds. </code></pre> <p><a href="http://api.jquery.com/jQuery.getScript/" rel="nofollow">http://api.jquery.com/jQuery.getScript/</a></p> <p>UPDATE: You need to execute your jQueryUI code after jQueryUI is completely loaded. Right now you're trying to execute jQueryUI code as jQueryUI is loading. Try this instead. Note how I'm not using $(document).ready(), but instead registring an anonymous function to be run after successful completion of jQuery.getScript().</p> <pre><code>function main() { // Add some validation here to make sure UI is not loaded etc... jQuery.getScript('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js', function() { var $ = jQuery; // Since we don't get this as an event parameter and we're using jQuery.noConflict() var date = new Date(); var m = date.getMonth(), d = date.getDate(), y = date.getFullYear(); $('.datepicker').datepicker({minDate: new Date(y, m, d)}); /******* Load HTML *******/ var jsonp_url = "/search/form/%AFFILIATE_ID%/%FORM_TYPE%/"; $.getJSON(jsonp_url, function(data) { $('#my-widget').html(data); }); }); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload