Created
January 31, 2013 12:43
-
-
Save wise9/4682601 to your computer and use it in GitHub Desktop.
どこでも動的更新
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
$.fn.extend({ | |
refresh: function(selector, url){ | |
var that = $(this); | |
$.ajax({ | |
url: url || location.href, | |
type: 'GET', | |
success: function(res) { | |
content = $(res).find(selector).html(); | |
$(that).each(function(){ | |
$(this).html(content); | |
}); | |
}, | |
error: function(){ | |
} | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment