onload-event Questions

7

Solved

In JavaScript, when I want to run a script once when the page has loaded, should I use window.onload or just write the script? For example, if I want to have a pop-up, should I write (directly ins...
Gaberones asked 24/11, 2013 at 20:0

12

Solved

I've got the following code in a website: window.onload = resize; window.onresize = resize; function resize(){ heightWithoutHeader = (window.innerHeight - 85) + "px"; document.getElementByI...
Sexdecillion asked 11/5, 2010 at 12:56

5

Solved

I am trying to use Google's model-viewer web component to display a model on my website. The documentation says the component has a 'loaded' property which is 'read only' and 'returns true if the l...
Wacke asked 7/7, 2020 at 12:5

1

Is is possible to get the onload event for the pwa application in general. I meant we had implemented the a custom versioning logic in-order to keep the app version based on database field.(ie clea...
Metalinguistic asked 6/4, 2019 at 3:42

4

I have an iFrame, where I want to send a JavaScript command after loading. My current code looks like this: <iframe src="http://www.test.tld/" onload="__doPostBack('ctl00$ctl00$bLogout','')"&gt...
Lateritious asked 24/3, 2015 at 13:28

2

Solved

How do I run a function when a stylesheet finishes loading? Here is my code.. var d = document, css = d.head.appendChild(d.createElement('link')) css.rel = 'stylesheet'; css.type = 'text/css'; ...
Declamation asked 13/5, 2019 at 19:6

5

Solved

I have an aspx that has the following javascript function being ran during the onload event of the body. <body onload="startClock();"> However, I'm setting the aspx up to use a master page...
Lowelllowenstein asked 3/6, 2009 at 18:57

2

I am trying to display GIF from the giphy api on react native. Gifs take time to display on screen so I want to display a spinner on the midtime. The onLoadEnd event seem to be never fired on the ...
Contrapuntist asked 5/5, 2018 at 10:23

5

Solved

I am having trouble with the window.onload and document.onload events. Everything I read tells me these will not trigger until the DOM is fully loaded with all its resources, it seems like this isn...
Gemmule asked 20/3, 2010 at 23:56

5

The following message appears when viewing a site page in the chrome debug log. Uncaught ReferenceError: _gaq is not defined The page itself is supposed to track an object using the onload eve...
Alacrity asked 1/5, 2012 at 17:49

1

Solved

Very old, but very UNsolved subject: image.onload not called. Code tells the story better than words ... Calling .html = <script> var newConnection = new MeasureConnectionSpeed(); if (new...
Interpretative asked 28/7, 2015 at 3:3

5

Solved

How do I get this function to not only run on window resize but also on initial page load? $(window).resize(function() { ... });
Harvey asked 8/4, 2010 at 2:17

5

Solved

We want to include a maps from Google Maps API in our document. The documentation tells to initialize the map with a function called by the onload() event of the body. The ordinary way to call: &lt...
Lontson asked 22/2, 2011 at 18:21

1

I have a page which dynamically adds SVGs to the page via jQuery: grid.append($('<object>') .load(function () { // do stuff alert('loaded') }) .attr({ id: 'tile', type: 'image/svg+xml', ...
Hansom asked 26/8, 2012 at 19:24

3

Solved

I have a simple page, just trying to attach a load event to the document. I am not sure which event handler to use in jQuery to do this with. I tried $() and $(document).ready and .load but neither...
Medarda asked 26/4, 2012 at 7:8

3

Solved

is there a way I can get a Load event for System.Windows.Forms.Control just like System.Windows.Forms.Form.Load? I want to run some initialize code before the control first shown. Also, it would ...
Redpoll asked 10/12, 2009 at 1:52

3

Solved

I inherited this piece of code and it seems sub-optimal and possibly incorrect since it's adding event listeners on both the window and document objects. However, it is working properly except for ...
Webfooted asked 1/8, 2011 at 17:46

3

Solved

I've been playing around with adding hidden iframe elements to a page, and I want to manipulate the DOM of the these once loaded. I've noticed that I can't start manipulating the DOM immediately af...
Pugh asked 7/3, 2011 at 14:26

3

Solved

I'm working with a client and I'm only allowed to use javascript (don't ask why as I have no idea). They don't have jquery setup and they don't want it (once again I have no idea why) Anyways ther...
Objective asked 7/3, 2011 at 14:27

2

Solved

I have a need to dynamically include and run a script in a page. I am using an image onload event for this: <img src="blank.gif" onload="DoIt" /> The DoIt function looks like this (just ma...
Pyrochemical asked 3/12, 2010 at 3:13

2

Solved

For winforms applications I'm wondering what setup code should go in: MainForm() as opposed to MainForm_Load(object sender, EventArgs e) Are there any best practice guidelines here?
Klipspringer asked 26/3, 2010 at 5:43

3

Solved

I am n00b at rails. The question is very simple, i want to know how can i make a javascript function call inside body tag on the onLoad event. I'm asking this because in the views i can't find any...
Acidulant asked 26/11, 2009 at 20:8

3

When a form loads, the code needs to do things like setup datagrids, comboboxes, set the title, etc. I've tended to always use the load event rather than the new (constructor). Are there any guidel...
Mehala asked 5/11, 2008 at 5:25
1

© 2022 - 2024 — McMap. All rights reserved.