Skip to content

Instantly share code, notes, and snippets.

@wise9
Created January 31, 2013 12:43
Show Gist options
  • Save wise9/4682601 to your computer and use it in GitHub Desktop.
Save wise9/4682601 to your computer and use it in GitHub Desktop.
どこでも動的更新
$.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