I am trying to patch two functions within the Chosen jQuery library, however, no matter what I have tried to reference the original functions, console comes back with Chosen is undefined.
Here is my code.
function(){
var _no_results = window.jQuery.fn.chosen.prototype.no_results;
var _no_results_clear = window.jQuery.fn.chosen.prototype.no_results_clear;
window.jQuery.fn.chosen.prototype.no_results = function (terms) {
console.log('nr');
var no_results_html;
no_results_html = $('' + this.results_none_found + ' ""');
no_results_html.find("span").first().html(terms);
if (this.options.no_results_callback) {
this.options.no_results_callback(no_results_html, terms);
}
return this.search_results.append(no_results_html);
//return _no_results.apply(terms);
}
window.jQuery.fn.chosen.prototype.no_results_clear = function (terms) {
console.log('nrc');
var no_results_html;
no_results_html = $('' + this.results_none_found + ' ""');
no_results_html.find("span").first().html(terms);
if (this.options.no_results_clear_callback) {
this.options.no_results_clear_callback(no_results_html, terms);
}
return this.search_results.find(".no-results").remove();
//return _no_results_clear.apply(terms);
}
}
Any ideas?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)