显示gif动画

时间:2013-04-03 20:32:54

标签: jquery

我有这个代码来加载一个gif,但我不理解$(".block1").load("views/changepass.template.php");部分。请解释一下。

$(function() {
    $(".changepass").click(function() {
        $(".block1").load("views/changepass.template.php");
        return false;
    });
});

1 个答案:

答案 0 :(得分:0)

这是脚本的注释版本,它应该解释所有内容:

$(function() {//When the document is ready to be interacted with, ...
    $(".changepass").click(function() {//establish a 'click' event handler for .changepass element(s), which ...
        $(".block1").load("views/changepass.template.php");//loads content from the server into .block1 element(s), then ...
        return false;//ensures the natural 'click' action of the clicked element is not executed.
    });
});
相关问题