1

I need to load the contents of several arrays into a list depending on what menu item is selected. here is a fiddle I made - was hoping someone could help me find out why the values are returning NULL http://jsfiddle.net/whiteb0x/P47KZ/

3
  • I see your example but I don't quite understand what exactly is your problem. Can you specify? Commented Feb 9, 2012 at 1:06
  • the click event should trigger a specific array to be loaded into the <li>'s - see the if($(this).text() == vars[1]) it is saying if the text from the link matches the key value from the array then load it Commented Feb 9, 2012 at 1:08
  • Mmm...I think you need to clarify this even more. What should happen if I press "Player"? I can read the code, but you should tell us what is the expected behavior cuz maybe what's wrong it's precisely the code. Commented Feb 9, 2012 at 1:09

1 Answer 1

2

In the populateCurrentData method, $(this) doesn't refer to what you think it does - it refers to window. Pass $(this) into it as a parameter when you call it: http://jsfiddle.net/P47KZ/3/

Sign up to request clarification or add additional context in comments.

2 Comments

OH MAN, thank you so much JOE if I had a higher rep I would 1 up you, please someone vote :)
Pah, that's no excuse to not 1-up me... oh, wait. Never mind :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.