Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 425887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:25:28+00:00 2026-05-12T19:25:28+00:00

A good example is the SO star on the left hand side of this

  • 0

A good example is the SO star on the left hand side of this post.

You can click on it to add this message in your favorite and click again to remove this flag.

I already create a page /favorites/add/{post_id}/ but how to handle that in Ajax ?

Many things to do :

  • Be sure that it worked when you click
  • Change the image
  • Change the link if it is to add or remove the flag.

I am sure such a thing already exists, but I couldn’t find it.

Any idea ?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T19:25:29+00:00Added an answer on May 12, 2026 at 7:25 pm

    In javascript you add a event handler to the icon on the onclick event.

    Then you can just change the src attribute in the img element to change it to the correct image.

    I would suggest just sending the notification to the server and it can return the correct image to display, and then you just update the src attribute on the img element.

    The reason I would put the business logic on the server is to ensure that if for some reason the database was out of sync, it would show the correct result of the database, which is also the case if there was an error while changing the database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is there a good example of a source file containing Javadoc ? I can
Can I have good example or code about how to use Ajax Datepicker in
Can someone provide a good example of multiple UpdatePanels being updated by a singe
Can anyone point me to a good example on how to implement nested vertical
A good example of the behavior I'm trying to illustrate is when you click
A good example is www.espacio asir.com, which gives this result: image-link: http://api.browsershots.org/png/original/50/509a78b11505752692d066f07fff6661.png I don't
if anyone has a good example of how can I identify that the user
http://www.codeproject.com/KB/architecture/three_tier_architecture.aspx Does this website give a good example on 3-tier architecture? I thought it
I have not seen a really good example on the web. How can I
A good example of this is either on the Twitter launch screen (the screen

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.