且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

是否可以在不刷新整个页面的情况下加载页面内容

更新时间:2022-06-03 23:57:46

是的,你可以使用 jQuery.ajax()调用。像这样:
使用AJAX请求更改元素的文本:

Yes you can use the jQuery.ajax() call. Like this: Change the text of a element using an AJAX request:

$("button").click(function(){
    $.ajax({url: "demo_test.txt", success: function(result){
        $("#div1").html(result);
    }});
});

有关详细信息,请参阅本教程:
http://www.w3schools.com/jquery/ajax_ajax.asp

See this tutorial for more information: http://www.w3schools.com/jquery/ajax_ajax.asp