Im using ajax to load some data from a mysql database… my problem is, it getting the id for the data i want to load, i have set the HREF value as the id… so an example is:
`<a href="16" title="View Story: ssasds">ssasds</a>`,
16 is the id value i need… my code is:
$('.artefact').click(function()
{
var storyId = $('a',this).attr('href');
console.log(storyId);
}
when i check the console (firebug) it just says undefined. please try and help out, as i have tried other methods of getting the data but gets messy.
thanks
Seems like
.artefacthas twoas. Based on this:EDIT
On second thought, this looks cleaner: