before the ajax call get the $(this) object into a variable, like this:
var obj=$(this)
then use it into ajax success function

2009/6/3 phpn1b <alv...@gmail.com>

>
> I have a list where each list item has a click event attached to it.
> Upon clicking a list item, the click calls a PHP script and passes the
> list's title attribute as a parameter to the script. How can I take
> the data returned (some HTML) from the AJAX call and append it to the
> list item which was clicked? I know that the data variable contains
> the correct HTML coming back from the script and thought that $
> (this).append(data) would work but it doesn't. I was thinking of
> calling another function from within the AJAX return function call,
> but don't know how to reference the list item which was originally
> clicked.
>
> $('li').click(function(){
>        $.get('script.php',{folder:$(this).attr('title')},function(data){
>                ?
>        });
> });
>



-- 
Gustavo Salome Silva

Reply via email to