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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:20:43+00:00 2026-06-13T20:20:43+00:00

I have this JSON file: http://danish-regional-data.googlecode.com/svn/trunk/danish_regional_data.json How do I remove all the attribues within_5_km

  • 0

I have this JSON file: http://danish-regional-data.googlecode.com/svn/trunk/danish_regional_data.json

How do I remove all the attribues within_5_km, within_10_km, within_25_km, within_50_km, within_100_km for all postcodes?

I have read this question: Remove a JSON attribute

$(document).ready(function() {

    $.getJSON("post.json", function(data) {

    var pc = data.postalcodes;
    for (var id in pc) {
       if(pc.hasOwnProperty(id)) {
          for(var attr in pc[id]) {
             if(pc[id].hasOwnProperty(attr) && attr.indexOf('within_') === 0) {
               delete pc[id][attr];
             }
          }
       }
    }

    $("#json").html(pc);

    });

});
  • 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-13T20:20:45+00:00Added an answer on June 13, 2026 at 8:20 pm

    Go to the json url you provided and open the Firebug console. Then drop in the folloing code and execute it:

    var p = document.getElementsByTagName('pre');
    for(i=0; i < p.length; i++) {
    
      var data = JSON.parse(p[i].innerHTML);
      var pc = data.postalcodes;
    
      // this is the code i gave you... the previous is jsut to pull it out of the page
      // in Firebug - this works for me
    
      for (var id in pc) {
         if(pc.hasOwnProperty(id)) {
            for(var attr in pc[id]) {
              if(pc[id].hasOwnProperty(attr) && attr.indexOf('within_') === 0) {
                 console.log('Deleting postalcodes.'+id+'.'+attr);
                 delete pc[id][attr];
               }
            }
         }
      }
    }
    

    // assume data is the complete json
    
    var pc = data.postalcodes;
    for (var id in pc) {
       if(pc.hasOwnProperty(id)) {
          for(var attr in pc[id]) {
             if(pc[id].hasOwnProperty(attr) && attr.indexOf('within_') === 0) {
               delete pc[id][attr];
             }
          }
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some data and need to create a json file with this structure
I have this JSON http://www.progmic.com/ielts/retrive.php that I need to parse. When I do it
So in a js file I have this: if(players[i].src.indexOf(http:\/\/vimeo.com/moogaloop) == 0){ var videoId =
If I am to have this external json file: { http://example.org/about : { http://purl.org/dc/elements/1.1/title
I have this JSON file with Currency Rates: http://openexchangerates.org/latest.json Can someone help me with
I have a JSON file here: http://dalexl.webs.com/products.json I'm trying to read it on my
I have a JSON file which contains a pound symbol in it. This json
I have this swf (flash) file that provides the json that needs to be
I have a json file exported from phpmyadmin, it looks like this(utf-8 file): [{user_email:
I have a manifest.json file that looks like this: { name: Zend Debugger Extension,

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.