代碼不顯示我的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