Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in Namespacing through Yahoo Namespace

 
Tom Hopkins
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am trying to create a YAHOO NAMESPACE like

YAHOO.namespace("com.abc.def.lib.studentid");

The above thing is working fine, but as soon as i change like this

YAHOO.namespace("com.sjsu.js.lib.1234");

i get
"missing ; before statement 1" error

Any help greatly appreciated!!!

Regards,
Tom
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
functions/variables names can not start with a number.

Eric
 
Tom Hopkins
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Eric for reply, I am a newbie to javascript...

in this case, isnt this a string being passed like "com.abc.def.123"...i am not starting function with a number nor declaring a variable that starts with number.

Sorry if I am asking stupid questions.

If you can elaborate your answer, greatly appreciated.
Thanks in advance for your time.

Thanks
Tom
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic