2012-03-21 32 views
3
$(".eventName").click(
     function() { 
      var eventId = $(this).attr('id'); 
      var role = $(this).attr('dir'); 
      var todo = 'viewDetails'; 
      $("#details").load("plugins/company_calendar/calendar.php?eventId="+ eventId +"&todo="+ todo +"&role="+ role); 
      $(this).find('.eventDetails').css("left", $(this).position().left + 20); 
      $(this).find('.eventDetails').css("top", $(this).position().top + $(this).height()); 
      $(".eventDetails").fadeIn(10); 
     } 
    ); 

詳細に読み込んだデータを追加することはできますか?同じ時間にJqueryでAppendとLoad関数を使用できますか?

答えて

1

申し訳ありませんが、単に結果を要素の内容に置き換えます。

あなたは

$.get("plugins/company_calendar/calendar.php?eventId="+ eventId +"&todo="+ todo +"&role="+role, function(response) { 
    $("#details").append(response); 
}); 
0

を行う必要があります。また、このような何かを行うことができます。あなたがそれらを複数回使用する必要がある場合は、アペンダをカウントする必要がありますもちろんの

$("#details").append($("<div id='appender1'></div>")); 
$("#appender1").load("plugins/company_calendar/calendar.php?eventId="+ eventId +"&todo="+ todo +"&role="+ role); 

を。

+1

いいえid解決策: 'var appender = $("

").appendTo("#details1 "); appender.load( "/ foo.php?blah = qwert"); ' – frumbert

関連する問題