这是以前的工作为我好,但我认为有些事情改变了如何jQuery是在WordPress正在排队。
$(document).ready(function() {
$('#dialog-modal').dialog({
modal: true,
autoOpen: false,
closeOnEscape: false,
bgiframe: true,
title: 'Please Confirm',
buttons: {
"Ok!": function() {
$(this).dialog("close");
}
}
});
$("[name='records']").on('change',function(e){
var selectedValue = $(this).val();
if(selectedValue==2) {
$('#dialog-modal').dialog('open');
}
});
});
我的控制台显示:
遗漏的类型错误:$不是一个函数
我提到了这个问题:
TypeError: $ is not a function when calling jQuery function
但我仍然不知道如何正确包装。
你有排队的jQuery库在页面或标题? –