Skip to content

Instantly share code, notes, and snippets.

Created November 25, 2013 10:17
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/7639257 to your computer and use it in GitHub Desktop.
Save anonymous/7639257 to your computer and use it in GitHub Desktop.
reload sf2 wdt on ajax request
$(document).ajaxComplete(function(event, XMLHttpRequest){
var token = XMLHttpRequest.getResponseHeader('x-debug-token'),
protocol = window.location.protocol,
hostname = window.location.hostname;
if(token) {
$.get(protocol+'//'+hostname+'/_wdt/'+token, function(data){
$('.sf-toolbarreset').remove();
$('body').append(data);
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment