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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:15:40+00:00 2026-05-25T02:15:40+00:00

I am creating a Point System, and once people get enough points, they can

  • 0

I am creating a Point System, and once people get enough points, they can use some of the points to get cool features on my site. The using points part (detracting points each time the user gets something with their points) of the code is not working. Here is my jQuery for the Point System:

$(document).ready(function(){
   $('#curren').delay(200).animate({'top' : '-1px'},1500);
if (localStorage.points222){
  localStorage.points222=Number(localStorage.points222) +5;
}
else{
  localStorage.points222=0;
}
function buy5(){
  if (localStorage.points222){
  localStorage.points222=Number(localStorage.points222) -5;
}
else{
  localStorage.points222=0;
}
} 
   $('#point_counter').html(localStorage.points222);

if(Number(localStorage.points222) > 1){
   $('#point_name').html("1");
   $('#take').fadeIn();
}
else{
   $('#take').fadeOut();
} 
if(Number(localStorage.points222) > 500){
   $('#point_name').html("2");
}
if(Number(localStorage.points222) > 1000){
   $('#point_name').html("3");
}

if(Number(localStorage.points222) > 2000){
   $('#point_name').html("4");
}
if(Number(localStorage.points222) > 5000){
   $('#point_name').html("5");
}
if(Number(localStorage.points222) > 10000){
   $('#point_name').html("6");
}
if(Number(localStorage.points222) > 20000){
   $('#point_name').html("7");
}
});

and the HTML:

<div id="curren">
  Your Current Level: <b><span id="point_name"></span></b><br>
  Points: <b><span id="point_counter"></span></b>
  <span style="FLOAT:right;cursor:pointer;display:none;" id="take" onclick="buy5()">-5</span>
</div>

If you need more information on how the code is setup, please let me know.

  • 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-05-25T02:15:41+00:00Added an answer on May 25, 2026 at 2:15 am

    Short answer: you never update the displayed amount of points. You misplaced a line.

    The value in localStorage is indeed decreased by 5 every time a user clicks on the <span> and buy5() is called, but .. you never update the displayed value of points. In other words, the line..

    $('#point_counter').html(localStorage.points222);
    

    .. should be inside the definition of buy5, when right now it is one bracket too far. It’s not being called at the end of every buy5(), instead it’s called just once, as part of $(document).ready().

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

Sidebar

Related Questions

Can anyone point me to a guide for creating inf files? In particular, I'm
I am creating a photo editor app where, at some point, the photo you
OK so I am creating a system where whenever a shop signs up, they
Can someone please point me in the direction of an example creating a SamlAssertion
Creating my first site that uses the login/membership system provided in ASP.NET (v4). So
I found this question which is a great starting point towards creating embedded widgets
I am creating an web application and I at the point that i am
I'm convinced at this point that I should be creating subclasses of std::exception for
I am creating an RSS reader as a hobby project, and at the point
I'm creating a game with points for doing little things, so I have a

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.