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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:53:40+00:00 2026-06-07T00:53:40+00:00

I tried alot of things, but nothing worked. I’m using jQuery. So what I

  • 0

I tried alot of things, but nothing worked. I’m using jQuery.

So what I have to do is really to import http://jacce.dyndns.org/game/resources/game/map.php (so far I succeeded with $.getJSON), convert it to an array and then place it in a global variable.

I don’t really know how to do any of the last two things (well, I know how to create global variables, but not inside jQuery functions). So, any help?

EDIT: Here’s the JSON:

{
    "-5": {
        "-5": {
            "id": "1",
            "colour": ""
        },
        "-4": {
            "id": "2",
            "colour": ""
        },
        "-3": {
            "id": "3",
            "colour": ""
        },
        "-2": {
            "id": "4",
            "colour": ""
        },
        "-1": {
            "id": "5",
            "colour": ""
        },
        "1": {
            "id": "6",
            "colour": ""
        },
        "2": {
            "id": "7",
            "colour": ""
        },
        "3": {
            "id": "8",
            "colour": ""
        },
        "4": {
            "id": "9",
            "colour": ""
        },
        "5": {
            "id": "10",
            "colour": ""
        }
    },
    "-4": {
        "-5": {
            "id": "11",
            "colour": " fill=\"#A90000\""
        },
        "-4": {
            "id": "12",
            "colour": ""
        },
        "-3": {
            "id": "13",
            "colour": ""
        },
        "-2": {
            "id": "14",
            "colour": ""
        },
        "-1": {
            "id": "15",
            "colour": ""
        },
        "1": {
            "id": "16",
            "colour": ""
        },
        "2": {
            "id": "17",
            "colour": ""
        },
        "3": {
            "id": "18",
            "colour": ""
        },
        "4": {
            "id": "19",
            "colour": " fill=\"#A90000\""
        },
        "5": {
            "id": "20",
            "colour": ""
        }
    },
    "-3": {
        "-5": {
            "id": "21",
            "colour": ""
        },
        "-4": {
            "id": "22",
            "colour": ""
        },
        "-3": {
            "id": "23",
            "colour": ""
        },
        "-2": {
            "id": "24",
            "colour": ""
        },
        "-1": {
            "id": "25",
            "colour": ""
        },
        "1": {
            "id": "26",
            "colour": ""
        },
        "2": {
            "id": "27",
            "colour": ""
        },
        "3": {
            "id": "28",
            "colour": ""
        },
        "4": {
            "id": "29",
            "colour": " fill=\"#A90000\""
        },
        "5": {
            "id": "30",
            "colour": ""
        }
    },
    "-2": {
        "-5": {
            "id": "31",
            "colour": ""
        },
        "-4": {
            "id": "32",
            "colour": ""
        },
        "-3": {
            "id": "33",
            "colour": ""
        },
        "-2": {
            "id": "34",
            "colour": ""
        },
        "-1": {
            "id": "35",
            "colour": ""
        },
        "1": {
            "id": "36",
            "colour": ""
        },
        "2": {
            "id": "37",
            "colour": ""
        },
        "3": {
            "id": "38",
            "colour": ""
        },
        "4": {
            "id": "39",
            "colour": ""
        },
        "5": {
            "id": "40",
            "colour": ""
        }
    },
    "-1": {
        "-5": {
            "id": "41",
            "colour": ""
        },
        "-4": {
            "id": "42",
            "colour": ""
        },
        "-3": {
            "id": "43",
            "colour": " fill=\"#A90000\""
        },
        "-2": {
            "id": "44",
            "colour": ""
        },
        "-1": {
            "id": "45",
            "colour": ""
        },
        "1": {
            "id": "46",
            "colour": ""
        },
        "2": {
            "id": "47",
            "colour": ""
        },
        "3": {
            "id": "48",
            "colour": ""
        },
        "4": {
            "id": "49",
            "colour": ""
        },
        "5": {
            "id": "50",
            "colour": ""
        }
    },
    "1": {
        "-5": {
            "id": "51",
            "colour": " fill=\"#A90000\""
        },
        "-4": {
            "id": "52",
            "colour": ""
        },
        "-3": {
            "id": "53",
            "colour": ""
        },
        "-2": {
            "id": "54",
            "colour": " fill=\"#A90000\""
        },
        "-1": {
            "id": "55",
            "colour": ""
        },
        "1": {
            "id": "56",
            "colour": ""
        },
        "2": {
            "id": "57",
            "colour": ""
        },
        "3": {
            "id": "58",
            "colour": ""
        },
        "4": {
            "id": "59",
            "colour": ""
        },
        "5": {
            "id": "60",
            "colour": ""
        }
    },
    "2": {
        "-5": {
            "id": "61",
            "colour": ""
        },
        "-4": {
            "id": "62",
            "colour": ""
        },
        "-3": {
            "id": "63",
            "colour": ""
        },
        "-2": {
            "id": "64",
            "colour": ""
        },
        "-1": {
            "id": "65",
            "colour": ""
        },
        "1": {
            "id": "66",
            "colour": ""
        },
        "2": {
            "id": "67",
            "colour": ""
        },
        "3": {
            "id": "68",
            "colour": ""
        },
        "4": {
            "id": "69",
            "colour": ""
        },
        "5": {
            "id": "70",
            "colour": ""
        }
    },
    "3": {
        "-5": {
            "id": "71",
            "colour": ""
        },
        "-4": {
            "id": "72",
            "colour": " fill=\"#000D81\""
        },
        "-3": {
            "id": "73",
            "colour": ""
        },
        "-2": {
            "id": "74",
            "colour": ""
        },
        "-1": {
            "id": "75",
            "colour": ""
        },
        "1": {
            "id": "76",
            "colour": ""
        },
        "2": {
            "id": "77",
            "colour": ""
        },
        "3": {
            "id": "78",
            "colour": ""
        },
        "4": {
            "id": "79",
            "colour": ""
        },
        "5": {
            "id": "80",
            "colour": " fill=\"#A90000\""
        }
    },
    "4": {
        "-5": {
            "id": "81",
            "colour": ""
        },
        "-4": {
            "id": "82",
            "colour": ""
        },
        "-3": {
            "id": "83",
            "colour": ""
        },
        "-2": {
            "id": "84",
            "colour": ""
        },
        "-1": {
            "id": "85",
            "colour": ""
        },
        "1": {
            "id": "86",
            "colour": " fill=\"#A90000\""
        },
        "2": {
            "id": "87",
            "colour": ""
        },
        "3": {
            "id": "88",
            "colour": ""
        },
        "4": {
            "id": "89",
            "colour": ""
        },
        "5": {
            "id": "90",
            "colour": ""
        }
    },
    "5": {
        "-5": {
            "id": "91",
            "colour": ""
        },
        "-4": {
            "id": "92",
            "colour": ""
        },
        "-3": {
            "id": "93",
            "colour": " fill=\"#A90000\""
        },
        "-2": {
            "id": "94",
            "colour": ""
        },
        "-1": {
            "id": "95",
            "colour": ""
        },
        "1": {
            "id": "96",
            "colour": ""
        },
        "2": {
            "id": "97",
            "colour": ""
        },
        "3": {
            "id": "98",
            "colour": ""
        },
        "4": {
            "id": "99",
            "colour": ""
        },
        "5": {
            "id": "100",
            "colour": ""
        }
    }
}
  • 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-07T00:53:41+00:00Added an answer on June 7, 2026 at 12:53 am

    Ima place this answer cos I think the OP has confused arrays and objects.

    This will work:

    var t;
    
    $.getJSON('/url', {param: someparam}, function(data){
        t = data;
    });
    

    The data var represents the stringifyed JSON output and you basically just pass the output to a globally defined var…done.

    It will get your JSON out all into one Object. You cannot have an array since minus numbers are not counted as int arrray keys in JS.

    Bu this will allow you to do:

    $.each(t, function(){
        console.log($(this));
    });
    

    And get your “row” out.

    Or like:

    t['-3'];
    

    To understand this difference between arrays and Objects read here: http://www.hunlock.com/blogs/Mastering_Javascript_Arrays

    And another link: What is the difference between an array and an object?

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

Sidebar

Related Questions

I tried a lot of things, first in the css now with jquery but
I've tried a lot of things, but nothing is working. When I click on
I am trying to have a simple Navigation in my iOS-Project but nothing worked.
I need to substract 2 datetimes, I tried a lot of things but nothing
I have tried a lot of solutions but it did not work for me
I have tried a lot but not been able to understand the steps involved
There is a lot of code below but you dont have to really read
I've seen a lot of similar questions to this, but nothing that really matched.
I know this question has appeared few times, but the things are changing really
I've looked at a lot of the previous answers, and tried several things, but

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.