Skip to content

Instantly share code, notes, and snippets.

@marcromeyn
Last active August 10, 2017 08:06
Show Gist options
  • Save marcromeyn/ae40b83fd33dc33528398d47813f3fe3 to your computer and use it in GitHub Desktop.
Save marcromeyn/ae40b83fd33dc33528398d47813f3fe3 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
function titleModified(titleEl) {
alert("Title modifed");
alert(titleEl.text)
}
var titleEl = document.getElementsByTagName("title")[0];
var docEl = document.documentElement;
if (docEl && docEl.addEventListener) {
docEl.addEventListener("DOMSubtreeModified", function(evt) {
var t = evt.target;
if (t === titleEl || (t.parentNode && t.parentNode === titleEl)) {
titleModified(titleEl);
}
}, false);
} else {
document.onpropertychange = function() {
if (window.event.propertyName == "title") {
titleModified();
}
};
}
$('body').on('click', '#update_datatables', function() {
// alert("babababa");
$('#version_table').DataTable().destroy();
$('#version_table').DataTable().draw();
// console.log($('#version_table'));
});
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment