Linked Questions
233 questions linked to/from Vanilla JavaScript equivalent of jQuery's $.ready() - how to call a function when the page/DOM is ready for it
2460
votes
39
answers
1.4m
views
$(document).ready equivalent without jQuery
I have a script that uses $(document).ready, but it doesn't use anything else from jQuery. I'd like to lighten it up by removing the jQuery dependency.
How can I implement my own $(document).ready ...
-3
votes
3
answers
28k
views
document.getElementById returns null value [duplicate]
Hello I have these divs:
<div id="layoutGroup1">
<h2>UK Map</h2>
<div div style="width: 650px; height: 700px;" id="MapDIV"></div>
<div id="userUpdateDIV"&...
-2
votes
4
answers
24k
views
Run JavaScript after the page loads (document.ready) [duplicate]
I have the following script inside my master page :-
<script type= "application/javascript">
document.getElementById("currentdate").innerHTML = EMBEDformatAMPM();
var myVar=setInterval(function(...
4
votes
1
answer
5k
views
Function JavaScript between popup.html and popup.js in chrome extension (taking into account message from Background) [duplicate]
I would like to execute function in chrome extension (in popup.js) by clicking on button in a innerHTML.
My code in popup.html is:
<html>
<head>
<script src="popup.js">&...
1
vote
4
answers
1k
views
Javascript only working when inside the html document [duplicate]
I been trying to have an array populate a drop down, I got this examples from this post: JavaScript - populate drop down list with array
I'm using this html:
<select id="selectNumber">
<...
0
votes
0
answers
578
views
Use document.getElementById when DOM has not rendered [duplicate]
I have the following jQuery code in a project and I want to remove jQuery library from the project. So I am trying to convert this in to full javascript.
$(document).ready(function () {
$("#price-...
2
votes
1
answer
193
views
Is there a way to wait for the dom of a website to be loaded (not the full web-page)? [duplicate]
I would like to execute some javascript code on a web-page after it has loaded, but only the DOM.
I have seen that in the past you could use the document.onload event but that it is no longer ...
0
votes
0
answers
115
views
Best practice to implement callback function when DOM element rendered [duplicate]
While I do not know if it is possible, I am always facing such scenario for a long time without a "good" way to solve it. No matter what technology I used: ASP.NET, plaing JS/JQuery, any other web ...
-1
votes
1
answer
83
views
How do I call a JavaScript function's on loading my html page? [duplicate]
I have a page that has some functions that I would like to load when the page gets loaded .. Currently the function is called only when a button is clicked, I would also like this to loaded on page ...
74
votes
17
answers
97k
views
Add two functions to window.onload
I have two functions on my form except one does not work if the other is active. Here is my code:
window.onload = function(event) {
var $input2 = document.getElementById('dec');
var $input1 = ...
95
votes
7
answers
98k
views
How to check if DOM is ready without a framework?
The question is so like a zillion others here and on the web - How to check if DOM has loaded in Javascript? But here's the catch:
Without using a framework like jQuery etc;
Without knowing if your ...
46
votes
11
answers
180k
views
Hide all elements with class using plain Javascript
I normally use document.getElementById('id').style.display = 'none' to hide a single div via Javascript. Is there a similarly simple way to hide all elements belonging to the same class?
I need a ...
32
votes
6
answers
81k
views
Alternative for "$(document).ready" function
I am using fancybox in an aspx page. The document ready function does not work in this page for a lightbox. Someone told me to write a new javascript code for loading the lightbox in that page.
41
votes
5
answers
10k
views
Dollar sign before self declaring anonymous function in JavaScript?
What is the difference between these two:
$(function () {
// do stuff
});
AND
(function () {
// do stuff
})();
40
votes
2
answers
25k
views
Javascript like $(document).ready() for "modern HTML5" browsers
This is most likely already a question somewhere, but I cannot find it, as EVERY single search turns up jQuery questions.
I'm looking for a proven method to bind to the document being ready, much ...