What Is Being Done In The Following Javascript Codep Pre #920

What is being done in the following JavaScript code?</p> <pre><code class="language-javascript"> <script> if (window.attachEvent) window.attachEvent('onload', fetch); else window.addEventListener('load', fetch, false); </script> </code></pre>

Online Quiz This multiple choice question (MCQ) is related to the book/course gs gs106 Javascript. It can also be found in gs gs106 Invocation and Performance Navigation - JavaScript Lazy Loading - Quiz No.2.

What is being done in the following JavaScript code?

 <script> if (window.attachEvent) window.attachEvent('onload', fetch); else window.addEventListener('load', fetch, false); </script> 

Similar question(s) are as followings:



Online Quizzes of gs106 Javascript

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background