Php jQuery插件抛出";“类型错误”;在无冲突模式之外?
我试图将一个基于编辑器的表插入WordPress页面(如图所示),但遇到了以下错误:Php jQuery插件抛出";“类型错误”;在无冲突模式之外?,php,javascript,jquery,wordpress,datatables,Php,Javascript,Jquery,Wordpress,Datatables,我试图将一个基于编辑器的表插入WordPress页面(如图所示),但遇到了以下错误:TypeError:f[(“编辑器”+c)]未定义 令人费解的是,我使用了jQuery(function($){来摆脱noConflict模式,但这个问题仍然存在 你知道为什么吗 这是我用来构建表的jQuery: jQuery(function ($) { $( document ).ready(function(e) { var editor = new $.fn.dataTable.E
TypeError:f[(“编辑器”+c)]未定义
令人费解的是,我使用了jQuery(function($){
来摆脱noConflict
模式,但这个问题仍然存在
你知道为什么吗
这是我用来构建表的jQuery:
jQuery(function ($) {
$( document ).ready(function(e) {
var editor = new $.fn.dataTable.Editor( {
"ajaxUrl": "../wp-content/plugins/contacts/php/table.wp_contacts.php",
"domTable": "#wp_contacts",
"fields": [
{
"label": "Contact",
"name": "contact",
"type": "text"
},
{
"label": "Company",
"name": "company",
"type": "text"
},
{
"label": "Email",
"name": "email",
"type": "text"
},
{
"label": "Phone",
"name": "phone",
"type": "text"
},
{
"label": "Fax",
"name": "fax",
"type": "text"
},
{
"label": "Tax ID",
"name": "tax_id",
"type": "text"
},
{
"label": "Address",
"name": "address",
"type": "text"
}
]
} );
$('#wp_contacts').dataTable( {
"sDom": "Tfrtip",
"sAjaxSource": "../wp-content/plugins/contacts/php/table.wp_contacts.php",
"aoColumns": [
{
"mData": "contact"
},
{
"mData": "company"
},
{
"mData": "email"
},
{
"mData": "phone"
},
{
"mData": "fax"
},
{
"mData": "tax_id"
},
{
"mData": "address"
}
],
"oTableTools": {
"sRowSelect": "multi",
"aButtons": [
{ "sExtends": "editor_create", "editor": editor },
{ "sExtends": "editor_edit", "editor": editor },
{ "sExtends": "editor_remove", "editor": editor }
]
}
} );
});
});
发现TableTools需要在编辑器之前加载。一旦在编辑器之前为TableTools调用了“wp_enqueue_脚本”,一切都正常了