Skip to content

Commit 2b2f7b7

Browse files
committed
added window.onload and document.onload
1 parent af6a764 commit 2b2f7b7

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<title>front end Interview</title>
1212

1313
<!-- Bootstrap core CSS -->
14-
<link href="css/bootstrap.min.css" rel="stylesheet">
15-
<link href="css/bootstrap-responsive.css" rel="stylesheet">
14+
<link href="../css/bootstrap.min.css" rel="stylesheet">
15+
<link href="../css/bootstrap-responsive.css" rel="stylesheet">
1616
<!-- Custom styles for this template -->
1717
<style>
1818
/* Move down content because we have a fixed navbar that is 50px tall */
@@ -102,7 +102,7 @@ <h2><a href="css.html">css</a></h2>
102102
<p><a class="btn btn-default" href="css.html" role="button">View details &raquo;</a></p>
103103
</div>
104104
<div class="col-md-4">
105-
<h2>javaScript</h2>
105+
<h2><a href="js1.html">javaScript (part-1)</a></h2>
106106
<p>This is your battle field. you have to be rock solid in Javascript. thats what bring you the paycheck. In this section i will go through some mid to highlevel javascript interview qustions for a solid foundation... </p>
107107
<p><a class="btn btn-default" href="#" role="button">View details &raquo;</a></p>
108108
</div>
@@ -165,7 +165,7 @@ <h3>Invite to a talk</h3>
165165
<!-- Bootstrap core JavaScript
166166
================================================== -->
167167
<!-- Placed at the end of the document so the pages load faster -->
168-
<script src="js/jquery-2.0.3.min.js"></script>
169-
<script src="js/bootstrap.min.js"></script>
168+
<script src="../js/jquery-2.0.3.min.js"></script>
169+
<script src="../js/bootstrap.min.js"></script>
170170
</body>
171171
</html>

jsQuiz.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,15 @@ <h2>defer vs async</h2>
212212
<p><strong>defer</strong> defer keyword in the script tag will defer the execution of the script. Hence script will be executed when DOM is available. Important point is, defer is not supported by all major major browsers.</p>
213213
<p><strong>async</strong> if possible, set the execution of the script, asynchronously. <code>async</code> keyword has no effect on inline script.</p>
214214
<p> try to get some idea fromt he image copied from <a href="http://peter.sh/experiments/asynchronous-and-deferred-javascript-execution-explained/">JS script execution</a></p>
215-
<img src="images/asyncVsDefer.jpg" alt="">
216-
215+
<img src="images/asyncVsDefer.jpg" alt="">
216+
</div>
217+
<div id="onload">
218+
<h2>window.onload vs document.onload</h2>
219+
<p><strong>Question:</strong> What are the differences between document.onload and window.onload</p>
220+
<p><strong>Answer:</strong> <code>window.onload</code> is fired when DOM is ready and all the contents including images, css, scripts, sub-frames, etc. finished loaded.</p>
221+
<p><code>document.onload</code> is fired when DOM (DOM tree built from markup code within the document)is ready which can be prior to images and other external content is loaded.</p>
222+
<p><strong>bonus:</strong><code>document.readyState</code> Returns "loading" while the Document is loading, "interactive" once it is finished parsing but still loading sub-resources, and "complete" once it has loaded. The <code>readystatechange</code> event fires on the Document object when this value changes.</p>
223+
<p>ref: <a href="http://stackoverflow.com/questions/588040/window-onload-vs-document-onload"> stackoverflow</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/API/document.readyState">MDN: readyState</a></p>
217224
</div>
218225
<div id="showAndTell">
219226
<h2>show and tell</h2>
@@ -240,7 +247,7 @@ <h2>Question about JS</h2>
240247
<li>difference between .call .apply and .bind</li>
241248
<li>passing by value or by ref <a href="http://snook.ca/archives/javascript/javascript_pass/">js pass</a></li>
242249
<li>How to achieve static variable in JS</li>
243-
<li>what is window.onload</li>
250+
<li></li>
244251
<li>How will you make a website response </li>
245252
<li>If you want to make a website responsive, you will you start</li>
246253
<li>how will you start when you have to make a site compatible to different browser</li>

0 commit comments

Comments
 (0)