MDN wants to learn about developers like you:

element.onafterscriptexecute Redirect 1


Fired when a static <script> element  finishes executing its script. Does not fire if the element is added dynamically, eg with appendChild().


document.onafterscriptexecute = funcRef;

funcRef is a function reference, called when the event is fired. The event's target attribute is set to the script Element that just finished executing.


function finished(e) {
  logMessage("Finished script with ID: " +;

document.addEventListener("afterscriptexecute", finished, true);

View Live Examples


See also

Document Tags and Contributors

 Last updated by: Sheppy,