code_junkie

Ajax jQuery , beginner question

Nov 13th, 2011
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. jQuery(function(){ // Add Answer
  2.  
  3. jQuery(".add_answer").livequery('click',function(){
  4. var count = $(this).attr("alt");
  5. count++;
  6. var count1 = count-1;
  7.  
  8. $.get('quiz/select', function(p_type){ // Ajax Call for Select Data
  9.  
  10. $(this).parents('div:first').find('.a_type_'+count1+'').after('' + p_type + '');
  11. $(this).attr("alt", count);
  12.  
  13. });
  14. });
  15. });
  16.  
  17. jQuery(".add_answer").livequery('click',function()
  18. {
  19. var add_answer = $(this);
  20.  
  21. $.get(...)
  22. {
  23. add_answer.parents('div:first')...
  24. }
  25. }
  26.  
  27. jQuery(".add_answer").livequery('click',function(){
  28. var self = this;
  29. // ...
  30. $.get('quiz/select', function(p_type){
  31. // ...
  32. $(self).attr("alt", count);
Add Comment
Please, Sign In to add comment