How can I get the ID of the link when I click it in the xp:this.script ?
$(this).attr('id') will return an undefined cause this probably refers to the script not the xp:link
try this
$(this).getParent().attr("id")