Linked Questions
233 questions linked to/from $(document).ready equivalent without jQuery
1920 votes
10 answers
2.4m views
Vanilla JavaScript equivalent of jQuery's $.ready() - how to call a function when the page/DOM is ready for it [duplicate]
With jQuery, we all know the wonderful .ready() function: $('document').ready(function(){}); However, let's say I want to run a function that is written in standard JavaScript with no library backing ...
44 votes
3 answers
66k views
Is there a way to check document.ready() if jQuery is not available? [duplicate]
Possible Duplicate: $(document).ready equivalent without jQuery I know you can use the window.onload event to make functions run, but is there a way for a script to query if the document is ready ...
34 votes
4 answers
57k views
How to know when page is ready without using jQuery (alternative way)? [duplicate]
Possible Duplicate: $(document).ready equivalent without jQuery If you have jQuery called in your page. You can simply do it: $(document).ready(function() { /** code inside **/}); But how to do ...
5 votes
6 answers
20k views
How to detect document.ready in JavaScript? [duplicate]
Possible Duplicate: $(document).ready equivalent without jQuery I have a framework-less javascript that executes on load: function myJs() { // some code } window.load = myJs; But this ...
5 votes
2 answers
11k views
Vanilla JavaScript instead of jQuery - ready, on, click and end selector [duplicate]
I have in jQuery: $(document).ready(function() { $(document).on('click', "[id$='someId']", function () { console.log($(this).val()); }) }) How can I write it in pure JavaScript? $(...
4 votes
2 answers
6k views
i'm getting an Uncaught TypeError: Cannot set property 'onclick' of null? [duplicate]
i'm getting uncaught type error of: Uncaught TypeError: Cannot set property 'onclick' of null <!DOCTYPE html> <html> <head> <title>dice app</title> &...
7 votes
1 answer
11k views
Is a modern equivalent of $document.ready() still required in Vanilla JS apps? [duplicate]
When I learnt JavaScript a few years back, jQuery was still considered good standard practice, and it was recommended that the main application code be called from the $document.ready() event handler, ...
7 votes
0 answers
26k views
jquery document ready equivalent in Javascript? [duplicate]
i want to put my javascript code in head instead of body, but because the head loads before the body section in the html document, my code becomes useless as all selectors become undefined. in jquery ...
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
5 answers
1k views
add script to head that runs after the body has been loaded [duplicate]
How to add myFunction() in head that runs only after the body has been loaded. The reason I want to have it inside head is because that way I could put it in only one file instead of multiple. ...
-4 votes
1 answer
2k views
jQuery "$(document).ready(function () {" equivalent in Javascript [duplicate]
Possible Duplicate: $(document).ready equivalent without jQuery I want to wait until an ASP.NET datagrid is resized correctly before showing a popup message. This works great: $(document).ready(...
2 votes
3 answers
2k views
How to imitate cross-browser $(document).ready() behavior without JQuery [duplicate]
Possible Duplicate: $(document).ready equivalent without jQuery I have a script I need to write that needs to execute on DOM ready, but I can't have dependency on JQuery as part of the script. I ...
0 votes
3 answers
743 views
Convert jQuery to Javascript issue [duplicate]
I have some issues to convert jQuery code to JavaScript code. For example, I have this piece of code : $(document).ready(function() { doing some stuff }); I tried to code like this : ...
-2 votes
1 answer
728 views
How can I write this in Vanilla JS: $(function() {...}? [duplicate]
I need to know how to write $(function() {...} in vanilla JS. However, bc it looks like Google doesn't let you search the dollar sign, I can't find it. I do know how to do $(document).ready(function{.....
-2 votes
2 answers
180 views
how to make a div disappear if javascript is disabled [duplicate]
i want to make an input disappear if javascript is disabled, i have tried, <script> document.getelementbyid('mydiv').innerhtml= <input type=text>; </script> <div id="mydiv&...