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 8827893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:28:56+00:00 2026-06-14T07:28:56+00:00

i been implamenting a piece of code in my website that iv found trough

  • 0

i been implamenting a piece of code in my website that iv found trough phpacademy.org tutorials
the tutorial is ‘how to create a like button’. iv got the button to work o.k, but i need an extra bit on function. the problem is that when i click the like button the page pops back up to the top

function like_add(id){
$.post('like_add.php', {id:id}, function(data){
    if(data == 'success'){
        like_get(id);
    } else {
        alert(data);
    }
});
function like_get(id){
$.post('like_get.php', {id:id}, function(data){
    $('#article_'+id+'_likes').text(data);
});
function delete_like(id){
$.post('delete_like.php', {id:id}, function(data){
    if(data == 'success'){
        like_get(id);
    } else {
        alert(data);
    }
});
}

is there anything i can apply to this script to save the scroll position???…i have applied save scroll position to links on my website but i cant figure out this:(

cheers

  • 1 1 Answer
  • 0 Views
  • 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-06-14T07:28:57+00:00Added an answer on June 14, 2026 at 7:28 am

    You can use the following to find the current page scroll position.

    var scrollPosition = $(document).scrollTop(); 
    

    That will return the current scroll position of the page.

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

Sidebar

Related Questions

I've been implementing areas, but have found that it instantiates a development server for
I currently have a Python 2.6 piece of code that runs two loops simultaneously.
I have a piece of code that is working fine in IE, but it
I found the following piece of JavaScript code (maybe here at Stack Overflow?) for
I have been implementing Routing in my app following the tutorial http://docs.angularjs.org/tutorial/step_07 I couldn't
I've been implementing the youtube API in my website, the playVideo() for example works
For a fun project, I've been implementing a small thumbnail page on a website
There was this problem that has been asked about implementing a load byte into
I've been working with Android's TTS functions with general success however, one piece of
I have been implementing AES onto my website for security and I have ran

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.