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

  • Home
  • SEARCH
  • 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 8283297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:41:19+00:00 2026-06-08T10:41:19+00:00

I’m playing around with json objects in javascript and wanted see if someone could

  • 0

I’m playing around with json objects in javascript and wanted see if someone could help me out with a problem

My json file contains a list of hash objects containing a key (id) and the value being an array of [ ipaddress, timestamp, url]

e.g.

{"output":
    {
    "1":["10.0.0.1","2012-07-11T11:41:42+01:00","http://myurl.com"],
    "2":["10.0.0.1","2012-07-11T11:45:42+01:00","http://myurl2.com"],
    "3":["192.168.1.1","2012-07-11T11:41:47+01:00","http://myurl3.com"]
    }
}

What I want to do is be able to sort on the contents of the arrays

For example I’d like to go through the json and pull out the highest timestamp for each ip address

So an example output for the json above would look like:-

10.0.0.1 - http://myurl2.com
192.168.1.1 - http://myurl3.com

At the moment I have a simple function to output the raw data in a div, but I’m sure I could handle the arrays better

  var displayOutput = function(data){
    var container = $("#fragment-1");
   var body = “”;
    $.each(data.output, function(key, val) {
      var arr = val.toString().split(",");
      body = body + arr[0]+ ' - ' +  arr[1]) + ' - ' +  arr[2]
    });
    container.html(body);                                                
  };
  • 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-08T10:41:21+00:00Added an answer on June 8, 2026 at 10:41 am

    You will need to change the format as JSON arent to easy to sort.

    Maybe a multi dimensional array?

    Maybe this might help: Sorting an array of JavaScript objects

    Or this: http://www.devcurry.com/2010/05/sorting-json-array.html

    Or this: Sorting a JSON object in Javascript

    One of these will definitely lead to to a good solution. Need any help ask 🙂

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

Sidebar

Related Questions

Playing around with Flask and just wanted to print out some data as JSON
I was playing around with an idea and wanted to get some json from
While playing around with playframework yabe-siena-gae, I noticed a datastore file created for the
I just working with JSON data and am playing around with jQuery and Ajax
I am playing around with parsing JSON in jQuery and I am having trouble.
I have been playing around with this and wanted to get a second opinion.
I've been playing around with something I was hoping I could contribute to the
i'm new to android development and i'm playing around with json data. I managed
so I'm learning NodeJS and javascript in general, and playing around with it and
I am playing around with this page: http://www.problemio.com/problems/problem.php?problem_id=228 To reproduce the problem, log in

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.