Click here to Skip to main content
15,888,527 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: How to redirect in IE 11 Pin
Richard Deeming4-Sep-20 3:15
mveRichard Deeming4-Sep-20 3:15 
Questionwindow.open new window not showing up Pin
Member 1492460727-Aug-20 7:21
Member 1492460727-Aug-20 7:21 
AnswerRe: window.open new window not showing up Pin
Richard MacCutchan27-Aug-20 22:35
mveRichard MacCutchan27-Aug-20 22:35 
GeneralRe: window.open new window not showing up Pin
Member 1492460728-Aug-20 6:00
Member 1492460728-Aug-20 6:00 
GeneralRe: window.open new window not showing up Pin
Richard MacCutchan28-Aug-20 6:27
mveRichard MacCutchan28-Aug-20 6:27 
GeneralRe: window.open new window not showing up Pin
Member 1492460728-Aug-20 6:36
Member 1492460728-Aug-20 6:36 
GeneralRe: window.open new window not showing up Pin
Member 1492460728-Aug-20 11:07
Member 1492460728-Aug-20 11:07 
GeneralRe: window.open new window not showing up Pin
Richard Deeming31-Aug-20 22:32
mveRichard Deeming31-Aug-20 22:32 
QuestionTrouble communicating from brackets to chrome console Pin
Member 1492206724-Aug-20 19:00
Member 1492206724-Aug-20 19:00 
AnswerRe: Trouble communicating from brackets to chrome console Pin
F-ES Sitecore25-Aug-20 0:43
professionalF-ES Sitecore25-Aug-20 0:43 
GeneralRe: Trouble communicating from brackets to chrome console Pin
Member 1492206725-Aug-20 6:05
Member 1492206725-Aug-20 6:05 
GeneralRe: Trouble communicating from brackets to chrome console Pin
F-ES Sitecore25-Aug-20 7:02
professionalF-ES Sitecore25-Aug-20 7:02 
GeneralRe: Trouble communicating from brackets to chrome console Pin
Member 1492206725-Aug-20 9:21
Member 1492206725-Aug-20 9:21 
GeneralRe: Trouble communicating from brackets to chrome console Pin
Member 1492206725-Aug-20 6:44
Member 1492206725-Aug-20 6:44 
QuestionIterate nested json object in javascript and change the key names Pin
Member 1492059622-Aug-20 20:30
Member 1492059622-Aug-20 20:30 
var dataJSON = {
  "Name": "Group1",
  "Description": "Test Desc",
  "Countries": [
    { 
      "Id": "188b985",
      "Name": "USA",
      "states": [
        { 
          "state": "California",
          "stateNumber": 1,
          "neighbouringStates": [ "Oregon", "Neveda" ]
        }, {
          "state": "North Carolina",
          "stateNumber": 9,
          "neighbouringStates": [ "Virginia", "Georgia" ]
        } 
      ]
    }, {
      "Id": "218b985",
      "Name": "Canada",
      "states": [
        { 
          "state": "Alberta",
          "stateNumber": 21,
          "neighbouringStates": [ "British Columbia", "British Columbia" ]
        }, {
          "state": "Ontario",
          "stateNumber": 92,
          "neighbouringStates": [ "Manitoba", "Quebec" ]
        }
      ]
    }
  ] 
};

var excludeKeys = ["Id", "stateNumber"];

Looking for help with

making a copy of the dataJSON By eliminating the keys from excludeKeys collection.
iterate recursively/loop through dataJSON to a single object with all the nested keys and values.
After flatten, the keys should be something like this

{ 
  "Name": "Group1",
  "Description": "Test Desc",
  "Countries1/Id": "188b985",
  "Countries1/Name": "USA"
  "Countries1/states1/state": "California",
  "Countries1/states1/stateNumber": 1,
  "Countries1/states1/neighbouringStates": [ "Oregon", "Neveda" ],
  "Countries1/states2/state": "North Carolina",
  "Countries1/states2/stateNumber": 9,
  "Countries1/states2/neighbouringStates": [ "Virginia", "Georgia" ],
  "Countries2/Id": "218b985",
  "Countries2/Name": "Canada",
  "Countries2/states1/state": "Alberta",
  "Countries2/states1/stateNumber": 21,
  "Countries2/states1/neighbouringStates": [ "British Columbia", "British Columbia" ],
  "Countries2/states2/state": "Ontario",
  "Countries2/states2/stateNumber": 92,
  "Countries2/states2/neighbouringStates": [ "Manitoba", "Quebec" ]
};

AnswerRe: Iterate nested json object in javascript and change the key names Pin
Richard Deeming24-Aug-20 0:34
mveRichard Deeming24-Aug-20 0:34 
QuestionCan't set dropdown (option) value in static website after AJAX call Pin
huhuhhuhuh22-Aug-20 11:55
huhuhhuhuh22-Aug-20 11:55 
AnswerRe: Can't set dropdown (option) value in static website after AJAX call Pin
Richard Deeming23-Aug-20 23:21
mveRichard Deeming23-Aug-20 23:21 
GeneralRe: Can't set dropdown (option) value in static website after AJAX call Pin
huhuhhuhuh24-Aug-20 5:01
huhuhhuhuh24-Aug-20 5:01 
GeneralRe: Can't set dropdown (option) value in static website after AJAX call Pin
huhuhhuhuh28-Aug-20 3:18
huhuhhuhuh28-Aug-20 3:18 
GeneralJavascript coding question Pin
Member 1492033322-Aug-20 3:49
Member 1492033322-Aug-20 3:49 
GeneralRe: Javascript coding question Pin
GuyThiebaut22-Aug-20 4:44
professionalGuyThiebaut22-Aug-20 4:44 
GeneralRe: Javascript coding question Pin
Richard MacCutchan22-Aug-20 5:01
mveRichard MacCutchan22-Aug-20 5:01 
QuestionHow to edit a page in real time with a CMS? Pin
sakispal17-Aug-20 11:26
sakispal17-Aug-20 11:26 
QuestionLoad Webpage in JS condition Pin
Member 1491620017-Aug-20 7:48
Member 1491620017-Aug-20 7:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.