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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:51:55+00:00 2026-06-07T14:51:55+00:00

I have the following problem, I am using jquery mobile to build a webapp.

  • 0

I have the following problem, I am using jquery mobile to build a webapp.
On the startup page of the webapp (index.html) I am showing a list of events.
when a user clicks on a event, (eventsDetail.html) gets loaded. On this page users have te option to join a contest by ‘clicking the joinContest button’.

Question:
When I click the joinContest button multiple times and navigate back to index.html and click the .btn-showContests button only one id was stored (this is the id of the contest I clicked last)
How can I store all the id’s of the contests I have clicked on, so that when I navigate back to index.html and click the .btn-showContests it is getting all the id’s I have clicked?

file: eventdetails.js

$('.btn-joinContest').live('click', function(e){
    if (Modernizr.localstorage) {
        var id = getUrlVars()["id"];

        localStorage.setItem("contestId", id);
    } else {
        console.log('browser doesnt support localstorage')
    }   
});

file: eventlist.js

note: when i click the button .btn-showContests it executes this function.

function showContests(){
    var contests = localStorage.getItem("contestId");
    if(contests == null) {
        console.log('Nothing in store');
    }
    else if (contests.length === 0) {
        console.log('Store contains empty value');
    }          
    console.log(contests.length);       
}
  • 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-07T14:51:57+00:00Added an answer on June 7, 2026 at 2:51 pm

    I think every time you do the click on the button, you are overwriting the “contestId”, if you want to keep the list of the clicked items, you may want to do

    var currentlist = localStorage.getItem("contestId");
    currentlist = currentlist +" "+ id;
    localStorage.setItem("contestId", currentlist);
    

    or in better style.. store it in an array.

    hope this helps~

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

Sidebar

Related Questions

I have the following jQuery Mobile HTML code, the navbar's content is set using
i have the following problem : I'm using Jquery mobile , user can search
I'm facing following problem actually: I'm using Spring with jQuery. I have Controller: @Controller
I am using jQuery 1.7.1. and I have the following question/problem: The code has
I am using JQuery Mobile Datebox as I am having the following problem. I
I'm using jQuery and I have the following problem: In my site I have
I have a small question about using jquery. I have the following code: <html>
I have a jquery mobile page that uses the following code to hide a
On my index.html I am doing the following: <script src=jquery/jquery.js></script> <script src=managment.js></script> <script src=jquery/jquery.mobile-1.1.0.js></script>
I have the following problem. To translate a website, I'm using the jQuery Localize

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.