Skip to content

AJAX Usage

Victoria Bobey edited this page Nov 4, 2016 · 8 revisions

Profile Page

Profile Page

When viewing another author's page, a button will be displayed in the top right corner that allows the user to perform a follow/friend action.

When the button is clicked, an ajax request is sent to update the relationship state. Upon success, the button will be updated to display the appropriate action (unfollow, unfriend, follow, or accept friend request) for the new state.

Manage Friends and Manage Who I Am Following

Manage Friends

Ajax requests are sent each time a button is clicked to update the relationship sent.

Manage Friends: Initially, all friends are displayed with an Unfriend button. When the Unfriend button is selected, an ajax request is sent. Upon success, the button is updated to Accept Friend Request.

Manage Who I Am Following: Initially, all the authors I am following are displayed with an Unfollow button. When the Unfollow button is selected, an ajax request is sent. Upon success, the button is updated to Follow.

Pending Friend Requests

Friend Requests When I accept or decline a friend request, an ajax response is sent. Upon success, the friend request is no longer displayed on the page.

Clone this wiki locally