If its necessary to merge 2 or even more JavaScript objects - next function will help in it:
1 2 3 4 5 6 7 8 9 10 | function pn_merge_objects_options(obj1, obj2) { var obj3 = {}; for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; } for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; } return obj3; } |
