0
我是jquery的新手,想知道是否有人可以幫助我,我相信這是一個簡單的解決方案。爲什麼我不能得到一個元素的ID - jquery
我試圖讓當點擊一個鏈接的ID,然後提醒標識出這樣的:
缺少什麼我在這裏?導致螢火蟲給我一個'id is not defined'的錯誤。
$(document).ready(function(){
$("a.category").click(function(){
$.post("index.php", { id: "$(this).attr('id')"},
function(data){
alert("Data Loaded: " + id);
});
//return false to insure the page doesn't refresh
return false;
});
});
感謝有這方面的幫助。
嘿Slaks,錯字在第一行:你的意思是'id'財產。 – 2010-07-29 04:40:23