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/
-
I see your example but I don't quite understand what exactly is your problem. Can you specify?elclanrs– elclanrs2012-02-09 01:06:02 +00:00Commented 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 itJeff Voss– Jeff Voss2012-02-09 01:08:27 +00:00Commented 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.elclanrs– elclanrs2012-02-09 01:09:57 +00:00Commented Feb 9, 2012 at 1:09
Add a comment
|
1 Answer
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/