代码不显示我的PHP元素,我想知道为什么。用AJAX显示单独的PHP文档
这里是我使用的HTML:
<div class="tablocation">
<ul class="css-tabs">
<li><a class="current" href="/wp-content/themes/blue-and-grey/uni-general.php">General</a></li>
<li><a href="/wp-content/themes/blue-and-grey/uni-courses.htm">Courses</a></li>
<li><a href="/wp-content/themes/blue-and-grey/uni-inthearea.htm">In the area</a></li>
<li><a href="/wp-content/themes/blue-and-grey/uni-sportsandfacilities.htm">Sports & facilities</a></li>
</ul>
<div class="clear"></div>
<div class="css-panes">
<div style="display:block"></div>
</div>
就拿首先,对于单general.php - 这将不加载,但其他文件为的.htm会加载。只要它是一个PHP文档,它就不会。
另外 - 下面是我用来加载文档的脚本。
<script>
$(function() {
$("ul.css-tabs").tabs("div.css-panes > div", {
effect: 'ajax',
onBeforeClick: function(event, i) {
// get the pane to be opened
var pane = this.getPanes().eq(i);
// only load once. remove the if (...){ } clause if
// you want the page to be loaded every time
if (pane.is(":empty")) {
// load it with a page specified in the tab's href
// attribute
pane.load(this.getTabs().eq(i).attr("href"));
}
}
});
});
</script>
我可以提供PHP文件,如果需要但要公平我不认为这是问题所在。
哪些选项卡是您使用 – 2012-07-07 12:11:53
“将不会加载” 插件 - 在JavaScript控制台中的任何错误?空的内容? 404? – JJJ 2012-07-07 12:11:54
我没有空的内容,它是:http://www.jquerytools.org/demos/tabs/ajax-history.html#ajax1.htm – 2012-07-07 12:29:01