Is there any onDocumentChange event?

后端 未结 3 1704

Is there any event in Internet Explorer, that is fired whenever DOM is changed? For example:

document.attachEvent(\"ondocumentchange\", function () {
    ale         


        
3条回答
  •  青春惊慌失措
    2020-12-15 01:57

    Brute-force "solution":

    (function (previousInnerHTML) {
        return function () {
            if (document.body.innerHTML !== previousInnerHTML) {
                alert("you've just (at max 33ms ago) changed DOM");
            }
            setTimout(arguments.callee, 33);
        };
    })(document.body.innerHTML)();
    

提交回复
热议问题