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.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Turn 3 .getjson() into 1

Hello All,

I am a newbie when it comes to JQuery and was wonder the best way to get this into one click.function(). Or would it be best to leave it as 3? Basically the only difference in the 3 click.functions() is the href id which I am passing to my .getJSON url. This is probably really simple but I'm not sure of the best way, maybe by getting the href id via .this somehow?

basically i am just using a an extra function as a template to give me a couple keywords to use privately in the onclick.
the vars addy and cat are set at build time, and the inner onclick function remembers those arguments, even though it doesn't accept any arguments of its own.

Last edited by rnd me; 01-09-2009 at 01:06 PM.

Create, Share, and Debug HTML pages and snippets with a cool new web app I helped create: pagedemos.com