Click here to Skip to main content
15,567,002 members
Home / Discussions / JavaScript
   

JavaScript

 
QuestionTrouble communicating from brackets to chrome console Pin
Member 1492206724-Aug-20 20:00
Member 1492206724-Aug-20 20:00 
AnswerRe: Trouble communicating from brackets to chrome console Pin
F-ES Sitecore25-Aug-20 1:43
professionalF-ES Sitecore25-Aug-20 1:43 
GeneralRe: Trouble communicating from brackets to chrome console Pin
Member 1492206725-Aug-20 7:05
Member 1492206725-Aug-20 7:05 
GeneralRe: Trouble communicating from brackets to chrome console Pin
F-ES Sitecore25-Aug-20 8:02
professionalF-ES Sitecore25-Aug-20 8:02 
GeneralRe: Trouble communicating from brackets to chrome console Pin
Member 1492206725-Aug-20 10:21
Member 1492206725-Aug-20 10:21 
GeneralRe: Trouble communicating from brackets to chrome console Pin
Member 1492206725-Aug-20 7:44
Member 1492206725-Aug-20 7:44 
QuestionIterate nested json object in javascript and change the key names Pin
Member 1492059622-Aug-20 21:30
Member 1492059622-Aug-20 21:30 
AnswerRe: Iterate nested json object in javascript and change the key names Pin
Richard Deeming24-Aug-20 1:34
mveRichard Deeming24-Aug-20 1:34 
Try something like this:
JavaScript
function flatten(target, object, prefix){
    if (Array.isArray(object)){
        object.forEach((value, index) => {
            flatten(target, value, prefix === "" ? (index + 1).toString() : prefix + (index + 1));
        });
        return;
    }
    
    if (typeof object === "object"){
        Object.keys(object).forEach(k => {
            flatten(target, object[k], prefix === "" ? k : prefix + "." + k);
        });
        
        return;
    }
    
    target[prefix] = object;
}

var dataJSON = { ... };
var merged = {};
flatten(merged, dataJSON, "");
alert(JSON.stringify(merged, null, 4));




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

QuestionCan't set dropdown (option) value in static website after AJAX call Pin
huhuhhuhuh22-Aug-20 12:55
huhuhhuhuh22-Aug-20 12:55 
AnswerRe: Can't set dropdown (option) value in static website after AJAX call Pin
Richard Deeming24-Aug-20 0:21
mveRichard Deeming24-Aug-20 0:21 
GeneralRe: Can't set dropdown (option) value in static website after AJAX call Pin
huhuhhuhuh24-Aug-20 6:01
huhuhhuhuh24-Aug-20 6:01 
GeneralRe: Can't set dropdown (option) value in static website after AJAX call Pin
huhuhhuhuh28-Aug-20 4:18
huhuhhuhuh28-Aug-20 4:18 
GeneralJavascript coding question Pin
Member 1492033322-Aug-20 4:49
Member 1492033322-Aug-20 4:49 
GeneralRe: Javascript coding question Pin
GuyThiebaut22-Aug-20 5:44
professionalGuyThiebaut22-Aug-20 5:44 
GeneralRe: Javascript coding question Pin
Richard MacCutchan22-Aug-20 6:01
mveRichard MacCutchan22-Aug-20 6:01 
QuestionHow to edit a page in real time with a CMS? Pin
sakispal17-Aug-20 12:26
sakispal17-Aug-20 12:26 
QuestionLoad Webpage in JS condition Pin
Member 1491620017-Aug-20 8:48
Member 1491620017-Aug-20 8:48 
AnswerRe: Load Webpage in JS condition Pin
ZurdoDev17-Aug-20 11:14
professionalZurdoDev17-Aug-20 11:14 
AnswerRe: Load Webpage in JS condition Pin
Richard Deeming17-Aug-20 22:46
mveRichard Deeming17-Aug-20 22:46 
AnswerRe: Load Webpage in JS condition Pin
Otekpo Emmanuel21-Aug-20 5:18
Otekpo Emmanuel21-Aug-20 5:18 
QuestionBeginner-Help with parsing out multi select drop downs Pin
Member 1491294312-Aug-20 9:01
Member 1491294312-Aug-20 9:01 
Questiondrawing-a-polygon-on-image-inside-canvas-after-zoom-in-out-and-panning Pin
Member 1491178111-Aug-20 0:31
Member 1491178111-Aug-20 0:31 
QuestionJquery problem to FIX ! Pin
imothep857-Aug-20 1:25
imothep857-Aug-20 1:25 
Rant[REPOST] Jquery problem to FIX ! Pin
Richard Deeming7-Aug-20 2:00
mveRichard Deeming7-Aug-20 2:00 
AnswerRe: Jquery problem to FIX ! Pin
jkirkerx7-Aug-20 10:28
professionaljkirkerx7-Aug-20 10:28 

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.