Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

access value in universal_variable array

Posted on 2014-01-15
2
Medium Priority
?
266 Views
Last Modified: 2014-01-15
window.universal_variable.test = {   
	value_1: "MI1849",
	value_2: "GBP",
	value_3: 777.52,
	value_4: [
		{
		value_4_1: {
			value_4_1_1: "13456",
			value_4_1_1: "78978",
			value_4_1_1: "98765465",
			value_4_1_1: "22"
			},
		value_4_2: 1,
		value_4_3: 769.82
		}
	], 
	value_5: ""
};

Open in new window


I would like to use javascript to access the value of value_4_1_1. How can I do this?
I can successfully target value_4 for example by targeting window.universal_variable.test.value_4

Thanks
0
Comment
Question by:Al4ddin2
[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
2 Comments
 
LVL 25

Expert Comment

by:Luis Pérez
ID: 39781983
Mmmmm... try
window.universal_variable.test.value_4[0].value_4_1_1
as you defined value_4 to be an array

Hope that helps.
0
 
LVL 25

Accepted Solution

by:
Luis Pérez earned 2000 total points
ID: 39781985
Sorry, I failed. I think it should be:
window.universal_variable.test.value_4[0].value_4_1.value_4_1_1
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult 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…

618 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