Solved

push to new array

Posted on 2013-12-30
2
202 Views
Last Modified: 2013-12-30
Dear all,
I got an error if it try to push to new array:
var DialogView = {};
DialogView.items.push({"name": "Dlg", "title": "Dlg01",  "width": 300,"height": 150 ,"ProductID":  1});

Open in new window

But I got error : TypeError: DialogView is null
0
Comment
Question by:ethar1
2 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 39747136
var DialogView = {};
DialogView.items = [];
DialogView.items.push({"name": "Dlg", "title": "Dlg01",  "width": 300,"height": 150 ,"ProductID":  1});
// now you've :
//{
//   items : [{
//       "name": "Dlg",
//       "title": "Dlg01",
//       "width": 300,
//       "height": 150 ,
//       "ProductID":  1}]
//}

Test page : http://jsfiddle.net/zxSea/
0
 

Author Closing Comment

by:ethar1
ID: 39747191
thanks
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question