Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

push to new array

Posted on 2013-12-30
2
Medium Priority
?
211 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 2000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
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…

688 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