के साथ jQuery UI लोड हो रहा है मैं एक विजेट बनाने की कोशिश कर रहा हूं जिसके लिए व्यक्ति को jQuery और jQuery.UI लोड करने की आवश्यकता है।getScript
लोड करने के लिए jQuery प्राप्त करना कोई समस्या नहीं है, लेकिन हेई जोड़ना हेडर बस काम नहीं कर रहा है और मुझे यह त्रुटि मिल रही है।
b is undefined
[Break on this error] (function(b,c){function f(g){return!b(...NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,
यहां लिपि अपने सरल रूप में है।
(function() {
// Localize jQuery variable
var jQuery;
/******** Load jQuery if not present *********/
if (window.jQuery === undefined || window.jQuery.fn.jquery !== '1.4.4') {
var script_tag = document.createElement('script');
script_tag.setAttribute("type", "text/javascript");
script_tag.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js");
script_tag.onload = scriptLoadHandler;
script_tag.onreadystatechange = function() { // Same thing but for IE
if (this.readyState == 'complete' || this.readyState == 'loaded') {
scriptLoadHandler();
}
};
// Try to find the head, otherwise default to the documentElement
(document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag);
} else {
// The jQuery version on the window is the one we want to use
jQuery = window.jQuery;
main();
}
/******** Called once jQuery has loaded ******/
function scriptLoadHandler() {
// Restore $ and window.jQuery to their previous values and store the
// new jQuery in our local jQuery variable
jQuery = window.jQuery.noConflict(true);
// Call our main function
main();
}
/******** Our main function ********/
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');
jQuery(document).ready(function($)
{
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);
});
});
}
})(); // We call our anonymous function immediately
कोई विचार मैं इसे कैसे हल कर सकता हूं?
हाय बेन, मैन मैं उस के बहुत करीब रहा हूं लेकिन यह बहुत अच्छा है। बहुत ज्यादा प्रयास। मैं आपके बक्षीस को 7 घंटों में पुरस्कृत कर सकता हूं जो मैं वापस करूँगा। – Lee
मुझे बहुत परेशानी बचाई, धन्यवाद! –