jquery, .next() not working when using in $.get callback function

Discussion in 'jQuery' started by eyes_drinker, Apr 4, 2010.

  1. #1
    Hello, I am newbie to Jquery, i need help for the following,

    When i use

       $(".rateit").click(function(){ 
      $(this).next(".rateoptions").html('My options data here'); 
      }); 
    Code (markup):
    It works smoothly, But when I use this in a callback function it doesn't work as follow;

       $(".rateit").click(function(){ 
      $.get("test.php",  function(data){  
      $(this).next(".rateoptions").html(data); 
      }); 
      }); 
    Code (markup):
    I will be thankful for your help regarding this fix.
     
    eyes_drinker, Apr 4, 2010 IP
  2. eyes_drinker

    eyes_drinker Member

    Messages:
    224
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #2
    eyes_drinker, Apr 6, 2010 IP