我正在尝试在wordpress中使用pjax。但是,每当我尝试单击通过ajax调用获取内容的链接时,都没有任何反应,并且页面正常加载,firebug控制台显示301 aborted error。有人可以帮忙吗?

最佳答案

如果您在wordpress中使用ajax,请在theam的function.php文件中进行操作,如以下示例所示

add_action('wp_ajax_do_ajax', 'our_ajax_function');
function our_ajax_function(){
     // now we'll write what the server should do with our request here
}


希望它会有所帮助:)

10-05 20:57
查看更多