且构网

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

在通过javascript调用的内容正在加载时,如何显示加载gif图像?

更新时间:2023-12-05 10:40:58

function viewNext(){
    $('#content').html('<img src="loading.gif" />').load("inc/content.php");
}

使用load()时,它将替换元素中的所有内容,包括gif,因此您不必手动隐藏它.

When you use load() it will replace anything in the element, including the gif so you dont have to manually hide it.