Linked Questions

1920 votes
10 answers
2.4m views

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 ...
chris's user avatar
  • 37k
44 votes
3 answers
66k views

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 ...
bobobobo's user avatar
  • 67.9k
34 votes
4 answers
57k views

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 ...
Ito's user avatar
  • 2,177
5 votes
6 answers
20k views

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 ...
Thomas's user avatar
  • 53
5 votes
2 answers
11k views

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? $(...
lakego's user avatar
  • 69
4 votes
2 answers
6k views

i'm getting uncaught type error of: Uncaught TypeError: Cannot set property 'onclick' of null <!DOCTYPE html> <html> <head> <title>dice app</title> &...
varun teja's user avatar
7 votes
1 answer
11k views

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, ...
finitud's user avatar
  • 639
7 votes
0 answers
26k views

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 ...
user avatar
4 votes
1 answer
5k views

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">&...
Jeremy Bergeret's user avatar
1 vote
5 answers
1k views

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. ...
d.b's user avatar
  • 32.6k
-4 votes
1 answer
2k views

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(...
anmarti's user avatar
  • 5,153
2 votes
3 answers
2k views

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 ...
David MZ's user avatar
  • 3,748
0 votes
3 answers
743 views

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 : ...
Sébastien Merour's user avatar
-2 votes
1 answer
728 views

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{.....
AviG's user avatar
  • 392
-2 votes
2 answers
180 views

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&...
webing's user avatar
  • 25

15 30 50 per page
1
2 3 4 5
16