If I were you I'd try to log what "this" is inside your second get's scope,
and I bet you'll be surprised to notice it's not what it was outside the
second get. That's why you should put your previous "this" in a variable so
when "this" changes with the scope the other variable still holds who you'd
like to talk to.

Michel Belleville


2009/11/24 coffeecup <gocoffee...@gmail.com>

> Hello,
>
> iam experimenting a little bit with jquery and have encountered the
> following problem.
>
> my project is a calendar which can be browsed and is drawed with ajax
> and events can be added, when clicking a day of the current month a
> div pops up which contains the overview of the selected day and lists
> all events. when clicking on a list item a more detailed info of this
> event should appear.
> viewing detailed info should only be possible if logged in.
>
> $(".thismonth").each(function(){ // for every day of the month
>  $(this).bind("click", function(e){  // click handler
>   $.get("main.php?action=getEventList"),function(data){  // get
> eventdata of the selected day
>      $("#eventdetails").html(data);   // display events of the
> selected day
>   $(".event").each(function(){  // for each event in the list
>    $(this).bind("click", function(e){   add click handler for event
> in the list
>      $.get("main.php?action=getEvenDetails"),function(data){   // get
> detailed info if logged in
>       $(this).html(data);  // display detailed info
>     });
> .........
>
> so.. if i skip the 2nd  $.get request and use just $(this).html
> ('test'); it works fine, when using get i get the following error (this
> [0].ownerDocument || this[0]).createDocumentFragment is not a
> function.
>
>
>
>
>
>

Reply via email to