I have a loads of reports. Each report as it's own page. When the user is on a page, I want them to be able to add a report to their favourites. I don't mean browser favourites, I mean their favourite reports when they log into the system
Googling this, for obvious reasons, brings back endless tutorials/scripts on how to add to the browser favourites which isn't what I want
I have a button saying "Add to Favourites". When this is clicked, the report should be added. The button should then be removed and replaced with one saying "Remove From Favourite"
I realise ASP/PHP will be needed to do the actual adding/removing but any guidance on how to achieve this would be most helpful.
Would it be something along the lines of
$(function() {
$('.report_add').click(function() {
this_id= this.attr("id");
$.ajax({
type: 'POST',
data: 'reportid'+this_id+'=&userid=789',
success: function() { ... },
error: function(){ ... },
url: '/url/',
cache:false
});
});
});