Created
August 20, 2013 14:24
-
-
Save WenLiangTseng/6282062 to your computer and use it in GitHub Desktop.
jQuery讀取(重新載入)部分網頁,不用全畫面重新整理
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//程式碼 | |
var url = "http://yourdomain.com/yourpage.html"; | |
$("#elementName").load(url+" #elementName>*",""); | |
//應用 | |
$('#button1').click(function() { | |
var url = "http:www.your-url.com?ID=" + Math.random(); //create random number | |
setTimeout(function() { | |
$("#elementName").load(url+" #elementName>*",""); | |
}, 1000); //wait one second to run function | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment