views:

43

answers:

0

How do I pass an onclick value <CFOUTPUT QUERY="questions"><A HREF="javascript;()" onClick="VoteNo('#ID#');" ID="VotedNo">I Vote No</A></CFOUTPUT> in to javascript so that the script can be used multiple times for different questions? I am also using cfajaxproxy with the javascript so that ID value also needs to be passed on to the CFC so that it can record the no vote with the proper question.

I have looked all over and can’t fine the answer or I just don’t know what I am looking for and don’t see it even if I did find the answer. I see apps. doing just this all the time like in FMyLife <span id="vote13403115"><a href="javascript:;" onclick="vote('13403115','2686','agree');">I agree, your life sucks</a> (2686)</span> so I know it can be done.

Now the javascript and cfc though cfajaxproxy I have now works great, but only for just one question. I have to reproduce the javascript, CFC, and the cfajaxproxy and add unique identifiers for each question, and that works great as well. But if I have 100 questions then I would have to make 100 javascript pages, 100 CFC's with 100 cfajaxproxy's for each one. It would be better to have one of each being used 100 times.

I did post all the code I have now to this http://stackoverflow.com/questions/3903471/need-to-turn-javascript-ajax-vote-script-into-reusable-dynamic-script-so-it-c but think I did ask the right question.

I know someone out there will look at this and go "thats easy, just add this and change that, and there you go". I just don't know enough javascript to know where to look.