首先感谢您提前提供任何帮助。
我正在尝试使用Jquery .load将一个php文件引入指定的#div,一旦它被清空。 php文件没有错误并按预期执行但是无论我如何指定文件位置我都得到一个带有firebug的404,我找不到似乎指定一个绝对路径,就像我可以用PHP。这是一件非常简单的事情,让我疯狂!
这是代码(我已将php ABSPATH作为示例包括在内:
<?php include (ABSPATH.'/wp-content/themes/bigformat/template-home-search.php');?>
<script type="text/javascript">
jQuery(document).ready(function($){
$("#performsearch").click(function(){
$("#displayresults").empty();
$( "#displayresults" ).load( "/template-home-search.php", function( response, status, xhr ) {
if ( status == "error" ) {
var msg = "Sorry but there was an error: ";
$( "#error" ).html( msg + xhr.status + " " + xhr.statusText );
}
});
return false;
});
});
</script>