English 中文(简体)
2. 及时或立即将AJAX带至.append(数据)
原标题:Getting AJAX to .append(data) with a delay or queue

因此,由于缺乏睡觉或完全的误解,我遇到麻烦,难以找到一条 j子。

因此,请向你表示我唯一的希望:

我有一个 j脏功能,根据Click=“特性”的一个要素执行。

<div id="next" onClick="choice( next ,  <? echo $page; ?> )"></div>

因此,从本质上讲,我所要达到的是:如果有一个要素,那么通过日本宇宙航空研究开发机构将相关数据称为PHP书,而这一数据则与先前讨论的隐藏内容相提并论,然后将上述内容重新放在重点。

我面临的问题是,无论我做什么(使用<代码>.queue或settimeout),还是仅仅在j Query中使用标准轮 que,日本宇宙航空研究开发机构的数据总是装上《宇宙航空研究开发机构》,任何拖延的企图都不会奏效。

下面是守则,事先感谢你提供任何帮助。

function choice(value, page) {
    var timer;
    $.get("http://<? echo ROOT; ?>includes/forms.php", { choice: value, page: page }, function(data) {
        clearTimeout(timer);

        $("#slideOut-inner").fadeOut(2000).empty();

        timer = setTimeout(show, 2200);

        function show() {
            $("#slideOut-inner").append(data).fadeIn(2000); 
        }
    });
}
最佳回答

定出延迟的outside美元的目标成功反馈,否则只有在客户收到服务器的答复后才会发生:

$("#slideOut-inner").fadeOut(2000, function() {
    $(this).empty();
    $.get("http://<? echo ROOT; ?>includes/forms.php", {
        choice: value,
        page: page
    }, function(data) {
        $("#slideOut-inner").append(data).fadeIn(2000);
    });
});
问题回答

在<代码>fadeOut()的回击中填append(>:

$.get("http://<? echo ROOT; ?>includes/forms.php", { choice: value, page: page }, function(data) {
    $("#slideOut-inner").fadeOut(2000, function() {
        $(this).empty()
            .append(data).fadeIn(2000);
    }).empty();
});




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...

热门标签