Questions tagged [domready]

the DOMContentLoaded event, the document.readyState property, or any of a number of JavaScript plugins, utilities, and modules that handle this event and property

The term "Dom Ready" generally refers to the DOMContentLoaded event or the document.readyState property, along with a number of JavaScript plugins, utilities, and modules that handle the DOMContentLoaded event or changes to the document.readyState property.

Syntax Examples

jQuery

$(document).ready(function() {
  console.log('ready');
});

AngularJS

angular.element(document).ready(function () {
  console.log('ready');
});

ded/domready

domready(function () {
  console.log('ready');
})

MooTools

window.addEvent('domready', function() {
  console.log('ready');
});

Resources

115 questions
3
votes
1 answer

Uncaught object at AngularJS + RequireJS + domReady

I had a working AngularJS application and started using RequireJS for module dependencies. Following this guide - http://www.startersquad.com/blog/angularjs-requirejs/ - with domReady plugin for manually bootstrapping angular app. Tested in Chrome…
Ilia Barahovsky
  • 10,158
  • 8
  • 41
  • 52
3
votes
3 answers

Triggering domready by force in jQuery?

Since placing javascript DOM methods in the bottom of the html page (after ) is a lot faster than using the jQuery 'ready' event, shouldnt we be forcing it by doing: $('document').trigger('ready'); ...after the body tag? I havent really tried…
David Hellsing
  • 106,495
  • 44
  • 176
  • 212
3
votes
2 answers

requirejs with jQuery .domready() is not fired correctly

When you load jquery 1.8.2 with requirejs 2.1.1 - $(document).ready() and $(window).load() events starts to behave really weird. Sometimes only one of them are fired sometimes both but in all cases they are fired after all content, images etc are…
norbertas.gaulia
  • 2,033
  • 3
  • 18
  • 19
3
votes
2 answers

DomReady with backbone.js

I am using backbone.js to create a single page app. I am new to backbone, so please forgive any wrong semantics. My Problem is when rendering the views. Initially, I have a javascript in my index.html that executes the some dom manipulation(image…
fhkurdi
  • 43
  • 6
3
votes
1 answer

How to wait for LESS JS to load the .less file?

My webpage includes a less file instead of css. This is parsed by the less js script. My site's js script fires on dom ready and based on different dom dimensions layouts the page. The problem is, over slow network my js file can fire before less js…
AppleGrew
  • 9,302
  • 24
  • 80
  • 124
2
votes
3 answers

Need some explanation about jQuery DOMready

I'm newbie to jQuery (I came to JavaScript from PHP). I grouped multiple jQ functions in seperate files. I have the following questions: is there any requirement that every jQ function must be inside domready? What if, 1 of my files already has…
Tural Ali
  • 22,202
  • 18
  • 80
  • 129
2
votes
0 answers

Migrate RequireJS domReady to Webpack Loader

I'm migrating a RequireJS project to Webpack and can't find a Webpack analog to domReady. In RequireJS, I require a null module with the domReady loader plugin, which marks itself as loaded once it receives the DOMContentLoaded…
Owen
  • 630
  • 6
  • 21
2
votes
1 answer

How to get links in each block PHP DomReady?

I have the following HTML DOM:
1
1
2
2
MisterPi
  • 1,471
  • 5
  • 17
  • 23
2
votes
3 answers

How to determine when AngularJS has finished rendering all of the components & directives

Is there any way to run scripts when AngularJS has finished rendering all the routes, components & directives? For example when all components and directives with a templateURL have finished rendering.
2
votes
2 answers

Do I need to wait `domReady` if I put all my scripts after ``?

Jquery has a ready method: $(document).ready(function(){ // my code }) It will execute my code when dom is ready. I have a question, if I put all my scripts after , e.g. // all kinds of html tags …
Freewind
  • 193,756
  • 157
  • 432
  • 708
2
votes
1 answer

Separating JS to multiple files

There are multiple pages on my web-project working with exactly same JS functions. I was copying and pasting same functions to all pages' js files. But recently seperated common functions to another js file named common_fns.js, for every page…
heron
  • 3,611
  • 25
  • 80
  • 148
2
votes
2 answers

How can I populate a dropdown list in an infowindow (Google Maps API v3)?

I have two arrays: one for article names, and the other for url links to each article. I am trying to populate a dropdown list within an infowindow with the article names, linking to each article when selected. It seems as if the links may have to…
Ian Campbell
  • 2,678
  • 10
  • 56
  • 104
1
vote
2 answers

How to know when an iframe is ready?

I have an iframe inside a web page, and I want to do something when it is ready. I tried 2 ways: In the parent page, I use this jQuery('#iframe').load(function() { //my code here }); this code will be executed when the iframe is finished loading…
Delta76
  • 13,931
  • 30
  • 95
  • 128
1
vote
2 answers

jQuery - "wait until ready"?

I have this slider on my website: http://css-tricks.com/examples/AnythingSlider/ It works fine, but I don't like the way it loads (you can see list of the images with list dots before it is ready). Is there a universal way of bypassing that? How to…
Wordpressor
  • 7,173
  • 23
  • 69
  • 108
1
vote
1 answer

MooTools DOMReady not firing in IE7 if attached after DOM is ready through yepnope

I am using yepnope to load my scripts, but when using IE7, it won't fire the Mootools domready OR load events if they have already been fired. Any idea why? Here is the code. yepnope([ { load: "/js/uncompressed/mootools.js", …