• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What does this JavaScript syntax mean?

 
Sophie Cameron
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I encountered this declaration in a JavaScript article but don't know what it means. Does anyone know it? Thanks.

 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is an class/object

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It creates an anonymous object instance with two properties: Element, and DOCUMENT set to the the values 1 and 2 respectively.

Equivalent to:
 
Yuriy Fuksenko
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic