2013-04-03 145 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