I'm new to jquery and was wondering if someone can help me with, what i believe is an easy solution.
I am trying to get the id of a link when click and then alert the id out like this:
What am I missing here? cause firebug is giving me a 'id is not defined' error.
$(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;
});
});
Thanks for any help on this.