File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes What does this JavaScript syntax mean? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "What does this JavaScript syntax mean?" Watch "What does this JavaScript syntax mean?" New topic

What does this JavaScript syntax mean?

Sophie Cameron

Joined: Jun 05, 2005
Posts: 24
I encountered this declaration in a JavaScript article but don't know what it means. Does anyone know it? Thanks.

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
It is an class/object

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63532

It creates an anonymous object instance with two properties: Element, and DOCUMENT set to the the values 1 and 2 respectively.

Equivalent to:

[Asking smart questions] [About Bear] [Books by Bear]
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
I think yahoo webservices can return something like that instead of XML - it is theirs work around of domain security. Search for JSON for more info.
I agree. Here's the link:
subject: What does this JavaScript syntax mean?
It's not a secret anymore!