Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. function favorite(id) {
  2. jQuery.ajax({
  3. url: "favorite.php",
  4. method: "POST",
  5. data: { id: id }
  6. });
  7. }
  8.  
  9. <button onclick="favorite('<?= $id ?>'); return false;">В избранное</button>
  10.  
  11. <button onclick="favorite('<?= $id ?>'); return false;">Удалить с избранного</button>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement