Javascript 我可以在Jquery中同时使用Append和Load函数吗?

Javascript 我可以在Jquery中同时使用Append和Load函数吗?,javascript,jquery,ajax,Javascript,Jquery,Ajax,是否可以在详细信息中附加我加载的数据 抱歉,只需将元素的内容替换为te result 你应该这样做 $(".eventName").click( function () { var eventId = $(this).attr('id'); var role = $(this).attr('dir'); var todo = 'viewDetails'; $("#details"

是否可以在详细信息中附加我加载的数据

抱歉,只需将元素的内容替换为te result

你应该这样做

$(".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);
        }
    );

或者你可以这样做:

$.get("plugins/company_calendar/calendar.php?eventId="+ eventId +"&todo="+ todo +"&role="+role, function(response) {
    $("#details").append(response);
});
$(“#详细信息”)。附加($(“”);
$(“#appender1”).load(“plugins/company#u calendar/calendar.php?eventId=“+eventId+”&todo=“+todo+”&role=“+role”);

当然,如果需要多次使用appender,则需要对其进行计数。

no-id解决方案:
var appender=$(“”)。appender(“#details1”);load(“/foo.php?blah=qwert”)
$("#details").append($("<div id='appender1'></div>"));
$("#appender1").load("plugins/company_calendar/calendar.php?eventId="+ eventId +"&todo="+ todo +"&role="+ role );