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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:28:40+00:00 2026-06-10T14:28:40+00:00

I have this code: $.get(‘http://mapit.mysociety.org/areas/’+ulo, function(response) { console.log(response); var areaList = []; for (var

  • 0

I have this code:

$.get('http://mapit.mysociety.org/areas/'+ulo, function(response) {

                        console.log(response);

                        var areaList = [];

                        for (var k in response) {
                                 var obj = response[k];
                                 areaList.push(obj);
                                 console.log(response[k]);

                            }
                        var len = areaList.length;

In Chrome, it works great, for example, change +ulo to wembley.

On the Chrome Dev Tool, I get the object as per the two console.log’s under the heading object:

Object
index_fb.js:41
[
Object
all_names: Object
codes: Object
country: “E”
country_name: “England”
generation_high: 18
generation_low: 1
id: 8258
name: “Wembley Central”
parent_area: 2488
type: “LBW”
type_name: “London borough ward”
proto: Object

But, same in firefox and i get this in the Firebug:

{“8258”: {“parent_area”: 2488, “generation_high”: 18, “all_names”: {}, “id”: 8258, “codes”: {“ons”: “00AEHE”, “gss”: “E05000104”, “unit_id”: “11458”}, “name”: “Wembley Central”, “country”: “E”, “type_name”: “London borough ward”, “generation_low”: 1, “country_name”: “England”, “type”: “LBW”}}

index_fb.js (line 41)

{

index_fb.js (line 48)

“

index_fb.js (line 48)

8

index_fb.js (line 48)

2

index_fb.js (line 48)

5

index_fb.js (line 48)

8

index_fb.js (line 48)

“

index_fb.js (line 48)

:

index_fb.js (line 48)

index_fb.js (line 48)

{

index_fb.js (line 48)

“

index_fb.js (line 48)

p

index_fb.js (line 48)

a

index_fb.js (line 48)

r

index_fb.js (line 48)

e

index_fb.js (line 48)

n

index_fb.js (line 48)

t

index_fb.js (line 48)

_

index_fb.js (line 48)

a

index_fb.js (line 48)

r

index_fb.js (line 48)

e

index_fb.js (line 48)

a

index_fb.js (line 48)

“

index_fb.js (line 48)

:

index_fb.js (line 48)

index_fb.js (line 48)

2

index_fb.js (line 48)

4

index_fb.js (line 48)

8

index_fb.js (line 48)

8

index_fb.js (line 48)

, etc etc

So, the Console.log(response) is right, but it seems to take every letter in the:

for (var k in response) {

k = numbers in firefox, where as in chrome, it deals with k as a whole number 8258.

How do I get around this so it works on both ?

Thanks

EDIT

This is the new code: Still the same issue:

$.get('http://mapit.mysociety.org/areas/'+ulo, function(response)  {

                        console.log(response);

                        var areaList = [];

                        for (var k in response) {

                            if (response.hasOwnProperty(k)) { 
                                 var obj = response[k];
                                 areaList.push(obj);
                                 }
                            }

I have also tried, but do I need to wrap the Get into a $.ajax to ensure it knows a json is returned. The app has an issue with using ajax to a none secure source.

So far no joy 🙁

  • 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-10T14:28:42+00:00Added an answer on June 10, 2026 at 2:28 pm

    Firefox considers your object to be a string. You should specify dataType:"json" to retrieve a proper JSON object, which properties you will be able to enumerate. Jquery allows you to set the dataType through the final parameter of $.get :

    $.get(url,successFunction,"json")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code to get the default constructor: Public Function f(ByVal t As
I have this code require 'mechanize' @agent = Mechanize.new page = @agent.get('http://something.com/?page=1') next_page =
I have this code function check(){ $.get(friend.php, { id: friendid }, function(data){ //Do stuff
I have this code to get results based in search query: $(document).ready(function(){ $('#envio').click(function(){ var
I have this code right here: // get host name from URL preg_match('@^(?:http://)?([^/]+)@i', http://www.joomla.subdomain.php.net/index.html,
I have this code to get the caller of my function's file name, line
i have this code in javascript: var object = { get: function(id){ sel =
I have this piece of code $.get('/proc.php?proc=get_color', function(data){ $('#offer_color').html(data); }); that is hosted on
i have this code to get the search resutls from the api: querygoogle.php: <?php
the xml <publication_date media_type=print> <month>1</month> <year>2011</year> </publication_date> I have used this code to get

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.