window onload vs document onload

0 votes

My question is which of the two is more widely supported: window.onload or document.onload?

Feb 9 in Java by Soham
• 8,730 points
48 views

1 answer to this question.

0 votes

For the window.onload by default, it fires only when the entire page loads, including its content which are the images and scripts. However, in various search engines it now takes over the role of document.onload and then fires when the DOM is ready. For the document.onload it is called only when the DOM is ready in which it can be prior to the images and only once the other external content is loaded. The most widely supported out of the two is the window.onload, and also some of the most modern internets have worked and successfully replaced document.onload with window.onload. However in issues related to the internet, in particular support issues are the crux of why many users are using libraries like jQuery to check whether or not the entire document is ready. It is done with the following commands:- 

$(document).ready(function() { /* code here */ }); 
$(function() { /* code here */ });
answered Feb 9 by Rahul
• 8,980 points

Related Questions In Java

+1 vote
1 answer

concat() vs “+” operator : In Java for String concatenation

Basically, there are two important differences between ...READ MORE

answered Apr 27, 2018 in Java by Rishabh
• 3,620 points
3,161 views
0 votes
1 answer

HashMap vs LinkedHashMap vs TreeMap

Hi, there is no as such difference ...READ MORE

answered May 5, 2018 in Java by v.liyyah
• 1,300 points
791 views
0 votes
1 answer

Comparable vs Comparator in Java

I think you are not alone who is ...READ MORE

answered May 11, 2018 in Java by code.reaper12
• 3,500 points
406 views
0 votes
1 answer

@Component vs @Repository vs @Service in Spring Framework

As you might be knowing, all these ...READ MORE

answered May 29, 2018 in Java by geek.erkami
• 2,680 points
2,486 views
0 votes
2 answers

C++ performance vs. Java/C#

The overhead of interpreting code is much higher than ...READ MORE

answered Dec 27, 2018 in Java by iangregor
• 300 points
425 views
0 votes
0 answers

jQuery.click() vs onClick

I have a huge jQuery application, and ...READ MORE

Feb 8 in Java by Rahul
• 8,980 points
17 views
0 votes
1 answer

jQuery checkbox change and click event

Have shared an approach which will add ...READ MORE

answered Feb 23 in Java-Script by Aditya
• 7,280 points
517 views
0 votes
1 answer

Presenting docket dtates inside html page by javascript

Use the Docker Engine Api:Docker Engine API ...READ MORE

answered Jun 20, 2018 in Docker by DareDev
• 6,890 points
196 views
0 votes
1 answer

Migrating proxy npm repo in nexus 3

I don't think you can achieve this ...READ MORE

answered Jun 22, 2018 in DevOps Tools by DareDev
• 6,890 points
768 views
0 votes
1 answer

window.location.href and window.open () methods in JavaScript

To answer your question, first of all, ...READ MORE

answered Feb 9 in Java by Rahul
• 8,980 points
589 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP