If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

I'm not entirely clear what you are trying to demonstrate with the code
when you have two different functions with the same name.

Not a normal way to code.
Can you elaborate?

Noo, I just wanted to spare myself from some extra typing

What I tried to explain is if you have a global variable and you declare a function within you want to use that same name for a local variable if you not use the var keyword you're going to effectively overwrite the valu of a glob variable and that's something you probably didn't want to do.

Awesome thanks a lot guys. And thanks again tech, Always quick on the responses. Almost finished with my second class now. I generally understand scope but theirs a few odds and ends that haven't been defined yet, Like this for example.

Anonymous functions are all well and good but should not be used where a simpler method exists.

In your case you would be much simpler if you had two JSON vars that then allow easier access to the items you require, can be made to initialize on load and offers simpler access without having to make variable global, something that is becoming frowned upon by those who set the programming standards in the WWW.

STOP using $ prefix on JavaScript variable names...
Please remember to wrap any code you have in forum tags:- [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]If you can't think outside the box, you will be trapped forever with no escape...