Posted on Leave a comment

Verbinden von JSON Objekten mittels DojoMerging JSON objects using Dojo

A simple way to merge JSON objects is to use dojo.mixin():

var jsonObj = {foo:"bar"};
var jsonObjNew = {bar:"foo"};
console.debug(dojo.toJson(dojo.mixin(jsonObj, jsonObjNew)));

The above code will result in {foo:”bar”, bar:”foo”}.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.