128
rated 0 times
[
130]
[
2]
/ answers: 1 / hits: 18022
/ 12 Years ago, mon, october 22, 2012, 12:00:00
The following code is what I am currently using to try and give the posts ID to vote.php, however this currently returns [object Object]. How would I be able to pass the correct id when a link is clicked?
<script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js></script>
<script>
$.ajax({
type: POST,
data: id= + $(this).attr(href, id),
url: vote.php
});
</script>
<a href=javascript:; id=1><div id=button>Like!</div></a>
<a href=javascript:; id=2><div id=button>Like!</div></a>
<a href=javascript:; id=3><div id=button>Like!</div></a>
Thanks!
More From » ajax