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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:27:39+00:00 2026-06-03T23:27:39+00:00

I have a json file like: { total: 86, success: true, rows: [ {a1_id:3231VB8,

  • 0

I have a json file like: { total: 86, success: true, "rows": [ {"a1_id":"3231VB8", etc. etc.

My problem is that when using jquery for entering markers in google maps from eg this json file, it won’t do so until I replace <total: 86, success: true, "rows":> by <"markers":> at the start of the json file.

Ok no problem doing that, but when I do so another json requests from the same url/file is broken.

Question: how should I deal with this? Is there a way to change the gmap code to deal with my json file or sh:

function(data) { 
    $.each( data.markers, function(i, m) {
            $('#map_canvas').gmap('addMarker', { 'position': new google.maps.LatLng(m.latitude, m.longitude), 'bounds':true } );
  • 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-03T23:27:42+00:00Added an answer on June 3, 2026 at 11:27 pm

    So essentially you’re asking how to rename the “rows” property from the JSON to be “markers”, because “markers” is what is used by that particular pieces of JS/jQuery code? And you need the change to be in that code so that the existing JSON can be used as is by other processes?

    If so, why not just make the following small change in your JS/jQuery code to reference the “rows” property instead of “markers”:

    ...
        $.each( data.rows, function(i, m) {
    ...
    

    The only change is to the first parameter passed to $.each(). The “total” and “success” parameters from your JSON don’t actually need to be removed because they are simply ignored by the code you’ve shown (both before and after my change).

    If for some reason you need to actually modify the data object, which I assume was created by parsing the JSON, you can try something like this:

        data = { "markers" : data.rows };
    

    That is, create a new object that has a single property, “markers”, which references the “rows” array from the original object, and then re-assign the data variable to point to the new object. Then simply use your $.each() as is.

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

Sidebar

Related Questions

I have an AS 3.0 class that loads a JSON file in using a
I have a Json file that looks like this: [ { field:val }, ....
I have a manifest.json file that looks like this: { name: Zend Debugger Extension,
I have a JSON file that I would like to create an multi-dimensional array
I have a JSON file that I would like to create an array from.
I have a json file that's like for e.g. [{fu: thejimjams, su: 232104580}, {fu:
I have json file that I have exported using TexturePacker, and it produces this
I have a json file that looks like this: { status: 200, data: {
I have a JSON file that has more name value pairs than I care
I have a large JSON file that contains A LOT of similar code. It's

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.