I create a custom WordPress page via widget where I want to active a widget using this code
jQuery(document).ready(function($) {
/* For $.chained.js */
$("#series").chained("#mark");
$("#model").chained("#series");
$("#engine").chained("#series, #model");
return;
/* Show button after each pulldown has a value. */
$("#engine").bind("change", function(event) {
if ("" != $("option:selected", this).val() && "" != $("option:selected", $("#model")).val()) {
$("#button").fadeIn();
} else {
$("#button").hide();
}
})
});
When I activated the widget, that code can work fine but if I inactivated the widget that code show error TypeError: $(....).chained is not function. So how to fix this ? Thank you ..