Skip to content

Instantly share code, notes, and snippets.

@iainurquhart
Created September 20, 2010 13:14
Show Gist options
  • Save iainurquhart/587876 to your computer and use it in GitHub Desktop.
Save iainurquhart/587876 to your computer and use it in GitHub Desktop.
Say you had your "add to favorites" link as so:
<p class="bookmark_link">
<a class="favorites_trigger" href="{path=/favorites/add/}{entry_id}">
Bookmark this
</a>
</p>
==========================================================
And your /favorites/add template:
{exp:favorites:save}
==========================================================
And the jquery:
$().ready(function() {
$('a.favorites_trigger') .click (function() {
$.get(this.href, function(data) {
$('p.bookmark_link').html(data);
});
return false;
});
});
==========================================================
et voila
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment