MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 348: Line 348:
     })
     })


// Add an event listener for the DOMNodeInserted event on the body element
mw.hook('ve.saveComplete').add(function() {
document.body.addEventListener('DOMNodeInserted', function (event) {
   console.log('Page saved!');
   // Check if the event was triggered by the #mw-content-text element, which contains the page content
   // Your code here
  if (event.target.id === 'mw-content-text') {
    console.log('test')
   }
});
});