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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:47:01+00:00 2026-06-10T09:47:01+00:00

I want create a web application that display a list of items. Suppose I

  • 0

I want create a web application that display a list of items. Suppose I have displayed a list view (say listobject1) of 3 items. when clicked on any of them I get new list view (say listobject2) which its value is according to listobject1. When again I click one of them I get another view. Now when I click back button i want to go back to previous list view i.e. when I’m now on listobject2 and again when back button is pressed I want to show listobject1. Can anybody tell me how I can do this in JavaScript?

Edit
I’m still study about the stuff but I can’t solve this problem yet. In order to clarify my problem now, here’s my code:

$(document).ready(function() {
$("#result").hide();
$("input[name='indexsearch']").live("click", function()  {
    
    $("#result").show();
    $("#result").empty();

    loading_img();
    var $textInput = $("[name='valueLiteral']").val();

    $.getJSON("get_onto", {
        "input" : $textInput
    }, function(json) {
        if(json.length > 0 ) {
            var arrayPredicate = [];
            var arrayObject = [];
            var arraySubject = [];
            $.each(json, function(index, value) {
                arraySubject[index] = value.subject;
                arrayPredicate[index] = value.predicate;
                if(value.objectGeneral != null) {
                    arrayObject[index] = value.objectGeneral;
                } else {
                    arrayObject[index] = value.objectLiteral;
                }
            }

            );
            var stmt = [];
            //concat all related array into string (create triple statement)
            $.each(arrayPredicate, function(k,v){
                stmt[k] = "<span class='subject' id="+arraySubject[k]+">" 
                    + arraySubject[k] + "</span> " + " -> " + v + " : "+ 
                     //change object from text to be button form
                    "<button class = 'searchAgain-button'  name = 'searchMore' \n\
                    value = " + arrayObject[k] + ">" + arrayObject[k] + "</button><br>       <br>";
            });
            stmt = stmt.sort();
            $.each(stmt, function(k,v){
                $("#result").append(v);
            });
        } else {
            var $noresult = "No Result : Please enter a query";
            $("#result").append($noresult);
        }
    });

    
});

$("button").live("click", function() {
    $("#result").show();
    $("#result").empty();

    loading_img();
    var $textInput = $(this).attr("Value");
    //var $textInput = "G53SQM";

    $.getJSON("get_onto", {
        "input" : $textInput
    }, function(json) {
        if(json.length > 0 ) {
            var arrayPredicate = [];
            var arrayObject = [];
            var arraySubject = [];
            $.each(json, function(index, value) {
                arraySubject[index] = value.subject;
                arrayPredicate[index] = value.predicate;
                if(value.objectGeneral != null) {
                    arrayObject[index] = value.objectGeneral;
                } else {
                    arrayObject[index] = value.objectLiteral;
                }
            }

            );
            var stmt = [];
            var searchMore = "searchMore";
            //concat all related array into string (create triple statement)
            $.each(arrayPredicate, function(k,v){
                stmt[k] = "<span class='subject' id="+arraySubject[k]+">" + arraySubject[k] + "</span> " + " -> " + v + " : "+ " <button class = 'searchAgain-button' name = " +searchMore + " value = " + arrayObject[k] + ">" + arrayObject[k] + "</button><br><br>";
        });
            stmt = stmt.sort();
            $.each(stmt, function(k,v){
                $("#result").append(v);
            });
        } else {
            var $noresult = "No Result : Please enter a query";
            $("#result").append($noresult);
        }
    });      
}); 

At first, user only see one button name "valueLiteral". After user perform 1st search, the result is return in a form of JSON and eventually put in stmt[] to display, which at this state the second button was create as a clickable-result which will automatically take the value of result and do second search if user click the second button.
Now the problem is, I want to add a 3rd HTML button name "back" to make the web display the previous result in stmt[] if user click on the button.

Hope this helps in clarify the problems, I’m still doing a hard work on this stuff since I’m a newbie in JavaScript. Appreciate all helps.

  • 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-10T09:47:03+00:00Added an answer on June 10, 2026 at 9:47 am

    This is what you want almost exactly the way you want it.

    You’ll have to use history.pushState to push these fake events into the history.

    Alternatively, you can use location.hash to store the current object, and update the hash every time you display a new list. Then onhashchange find the hash and display the appropriate list.

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

Sidebar

Related Questions

I want to create a web application that allows users to sign up, register
I want to create a web app that lets me create, store and display
For an internal customer service application, I want to create a web page that
I have created a web application using ASP.NET MVC3, and want to display a
I want to create site thumbnails through my web application, so I thought I
I am creating a web application in django and I want to create a
I'm working on a ASP.NET MVC3 web application and I want to create a
I'm building a web-application in JavaScript using the dojo framework. I want to create
I want to create a multi-module (maven) spring MVC application, with modules like: web
I have created blank Asp.Net-MVC 3 web application and want to write my own

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.