File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

What does this JavaScript syntax mean?

Sophie Cameron
Greenhorn

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
author
Rancher

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

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61654
    
  67

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] [Bear's FrontMan] [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.
 
 
subject: What does this JavaScript syntax mean?