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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:26:17+00:00 2026-06-03T14:26:17+00:00

I am making an app in html5.It is like a quiz based app. I

  • 0

I am making an app in html5.It is like a quiz based app. I am randomly fetching questions from the XML and displaying it one by one.I am using page navigation for that. After completing and submitting your answer u will switch to other page.if once i submit my answer i cannot attempt it back. but i can see the feedback and score on switching to that page that is my problem. I have display that feedback and score and to store it in local storage. i am able to do local storage but values that i am getting is overriding. so i am getting last submitted value.Now my concern is to divide that values navigation number wise.right now what is happening if i submit my answer and suppose i am at navigation number 3 n i am looking at navigation part 1 then there also i am getting last submitted value not the part 1 value.Please give ur suggestion and help me out for that.

Here is the code snippet:

//for navigation of pages
$(document).ready(function (){            
    /*$(document).bind("contextmenu",function(e){
    return false;
    });*/
    var obj;
    total=x.length;

    for(var j=0;j<x.length;j++)
    { 
        if(j==0)
        {
            $("#navigationlist").append('<li><a href="#" id="selected_link"  class="navg" onClick="display_nav('+j+',this);">'+(j+1)+'</a></li>');                 
            display_nav(j,$("#selected_link"))        
        }
        else
            $("#navigationlist").append('<li><a href="#" class="navg" onClick="display_nav('+j+',this);">'+(j+1)+'</a></li>');   
    }               

    $("#next").bind("click",function (){
        $(".navg").each(function(index){        
            if($(".navg").length==(i+1))
            {
                if(index==0)
                    obj=$(this);
                }
                else
                {
                if(index==(i+1))
                    obj=$(this);
            }
        });     


            for(var j=0;j<xmlDoc.getElementsByTagName("question").length;j++)
            {
                xmlDoc.getElementsByTagName("question")[j].removeAttribute("status");
            }

            $("#btnSubmit").attr("disabled","false");
            $("#btnSubmit").attr("onclick","checekAnswer()");

            display_nav(0,obj)
        }
        else
            display_nav((i+1),obj)
    });         
}); 


and

correctAnswers++;
            localStorage.setItem('feedback',JSON.stringify(feedback[0].childNodes[0].nodeValue));
            $("#feedback").append(score[0].childNodes[0].nodeValue);
            $("#feedback").append("<br/>");
            $("#feedback").append(feedback[0].childNodes[0].nodeValue);     
        }
        else
        {
            //var val = [];
            //val.push(feedback[0].childNodes[0].nodeValue);
            //localstorage.setItem('feedback', JSON.stringify(val));
            //localStorage.setItem('feedback',JSON.stringify(feedback[0].childNodes[0].nodeValue));
            //alert(localStorage.getItem("feedback"));
            /*var v={"test":feedback[0].childNodes[0].nodeValue};
            localStorage.setItem('feedback',v);
             alert(localStorage.getItem('feedback'));*/

            scores1.push(feedback[0].childNodes[0].nodeValue);

            localStorage.setItem("highscores",JSON.stringify(scores1));
            var scores = localStorage.getItem("highscores");

            alert(scores);
            scores = JSON.parse(scores);

            alert(scores[0]);

            $("#feedback").html(score[1].childNodes[0].nodeValue);
            $("#feedback").append("<br/>");
            $("#feedback").append(feedback[0].childNodes[0].nodeValue);
            $("#feedback").append("hello");

        }

        //$("#counter").html("left="+xPos+",top="+yPos);    
        $("#trFeedBack").show("slow");  
        display_nav(j,obj)  
    }
} // end function   
  • 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-03T14:26:19+00:00Added an answer on June 3, 2026 at 2:26 pm

    If I understand your question, your problem is to store items with same name but related to different pages.

    LocalStorage being defined by domain, and not by page, you must change the keys you use. The usual solution is to prefix the names you want.

    For example :

    localStorage['pages.12.feedback'] = "the feedback I'm giving related to page 12";
    localStorage['global.feedback'] = "the feedback I'm giving related to the global site";
    

    (you’ll notice I use the short notation, that I find more readable that using setItem)

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

Sidebar

Related Questions

Im making an 'app like' web page. The actual page is wider than the
Ok so I'm making a simple web app using the technologies from the topic,
Making a painting app using HTML5 and Canvas. I think I want to have
I am making a GWT app based off of an HTML mockup. The mockup
i m making APP which do image proceesing using java SE.i want to check
I'm making a Jeopardy board in HTML/JavaScript/XML. I want this app to be able
I am making an app a bit like a dictionary, where a user clicks
I am making a users profile page and if i route it like this
I making a web app in Flex using global coordinates I get the coordinates
I'm making a small Adobe AIR app (my first) using HTML+Javascript. I need to

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.