I have a simple index page with 3 links(with separate ids) and a empty <div></div> tag(with an id). I am able to get content to load into the empty div tags but I am also repeating jquery code to do so. I have limited experience creating variables and switch/case statements and I'm thinking that's the best way to go but can't get the code to work.
Here is the code I have so far: $(document).ready(function() { $('#letter-a a').click(function(){ $('#dictionary').load('a.html'); return false; }); }); $(document).ready(function() { $('#letter-b a').click(function(){ $('#dictionary').load('b.html'); return false; }); }); $(document).ready(function() { $('#letter-c a').click(function(){ $('#dictionary').load('c.html'); return false; }); });