插件wordpress

时间:2016-08-22 10:22:38

标签: javascript php jquery ajax wordpress

我正在尝试创建一个插件Wordpress来从我的服务中获取一些信息。在这第一时刻,我只想加载一个特色选择。

我安装了默认的Wordpress,并使用Jquery 1.11。然而,当我使用Divi在另一个wordpress中安装这个相同的插件时,我从Jquery获得了内部服务器错误。

我的ajax代码:

var speciality = '';
var htmlSpec = '';
jQuery.ajax({
    url: '/[path_plugin]/speciality.php',
    dataType: 'json',
    type: 'GET',
}).done(function(data) { 

    for(var spec in data){
        htmlSpec += '<option value='+spec+'>'+data[spec]+'</option>';
    }

    jQuery('select#specialities-list').append(htmlSpec);              
});

错误:

jquery.js?ver=1.12.4:4 
GET [path_plugin]/speciality.php 500 (Internal Server Error)
send @ jquery.js?ver=1.12.4:4
ajax @ jquery.js?ver=1.12.4:4
(anonymous function) @ VM312:3

有人知道我能做什么吗?

0 个答案:

没有答案