首先,請允許我向所有提供答案的人表示感謝......我絕對先進,甚至在本地計算機上,所有工作都完美無缺。任何人都可以告訴我爲什麼我的警報(id)沒有被解僱嗎? Nada,zilch,zippo
但它不在服務器上工作。我嘗試了一些東西,例如將session_start()放入包含的文件中,但沒有采取任何措施。
而不是在這裏發佈的代碼中,我拉上幾個文件:
http://nerotic.net/aux/code.zip
,你可以在同一個URL看到網站移除/code.zip
的index.php :在其中包含AJAX ... index_page_content.inc.php:是我的文件,用於確定包含哪些內容 backend.php:處理AJAX的PHP sound-how.php:其中包含的一個頁面by index.php
行爲很奇怪。它不會回顯'src',我會在其中回顯它,但它會顯示在我回顯'區域'的地方。但是一旦我重新加載它就會回到在同一個地方迴應'section'。
另外,在Chrome中,我點擊的每個鏈接都會使整個頁面重新加載。
因此,如果任何人都可以告訴我,我做錯了什麼:)提前
感謝。
原帖
我是新的PHP和再學習JS所以任何幫助,將不勝感激。
<script language="JavaScript"
type="text/javascript">
$(document).ready(function() {
$("div.tabs").tabs(".images > div", {
// enable "cross-fading" effect
effect: 'fade',
fadeInSpeed: 600,
fadeOutSpeed: 1000,
// start from the beginning after the last tab
rotate: false
// use the slideshow plugin. It accepts its own> configuration
}).slideshow({autoplay: false, interval:5000});
$("a.lnav").onclick(function() {
// Get the ID of the link
var src = $(this).attr("id");
alert(id);
// Send Ajax request to backend.php, with src set as "id in> the POST data
$.post("/backend.php", {"id": src});
});
}); </script>
你有從PHP輸出的HTML嗎? – Marko 2010-07-04 23:13:51
什麼Gert說:) – Marko 2010-07-04 23:14:13
對不起,選擇你,因爲這是jQuery用戶常見的事情,但'$(this).attr(「id」)'是瘋了。 'this.id'有什麼問題? – 2010-07-04 23:26:59