2013-04-03 147 views
-1

我有这段代码来加载gif,但我不明白$(".block1").load("views/changepass.template.php");部分。请解释。显示gif动画

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

有什么理由不得到什么? – 2013-04-03 20:34:40

+5

http://api.jquery.com/load/应该提供所有关于'.load()'方法 – Ian 2013-04-03 20:35:29

回答

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. 
    }); 
}); 
+0

thanax帮助很多的信息。 – Lzone 2013-04-03 20:59:35