JQuery load() and .prepend()

前端 未结 2 634
谎友^
谎友^ 2021-01-25 07:11

Okay so I have the following code:

function() { 
$(\"ul#postbit\").load(\'load.php\').fadeIn(\"slow\");
}, 3000);

What I am trying to achieve i

2条回答
  •  闹比i
    闹比i (楼主)
    2021-01-25 07:50

    You should check out the jQuery API. Here's the API for AJAX: http://api.jquery.com/category/ajax/

    $.ajax({
        url: 'load.php',
        success: function(data) {
            $("ul#postbit").prepend('
  • '+ data +'
  • '); } });

提交回复
热议问题