因客戶瀏覽自己網站時,網頁內老是被他瀏覽器某個 Plugin 插入一些 HTML Tag
加上一段偵測語法,隨時監測網頁內語法有無被改變(被偷加什麼語法)
<script>
$(function() {
$("html").bind("DOMSubtreeModified", function() {
console.log('dom changed');
//$( "#xxxxx" ).remove();
$( "#xxxxx" ).empty(); //移除
});
});
</script>
參考
Detect changes in the DOM
Is there a JavaScript/jQuery DOM change listener?