Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/230.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/407.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php jQuery插件抛出";“类型错误”;在无冲突模式之外?_Php_Javascript_Jquery_Wordpress_Datatables - Fatal编程技术网

Php jQuery插件抛出";“类型错误”;在无冲突模式之外?

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

我试图将一个基于编辑器的表插入WordPress页面(如图所示),但遇到了以下错误:
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_脚本”,一切都正常了