onload

Checking if iframe is ready to be written to

A 3rd party script on my web page creates an iframe. I need to know when this iframe is ready, so I can manipulate its DOM. I can think of a hacky approach: repeatedly try to modify the iFrame's DOM, and return success when a change we make sticks between two attempts. For this to work, I would prefer a property I can check on the ifram...

SimpleModal -- Open OnLoad

I'm new to JQuery -- not new to javascript. Was able to open the OSX STYLE DIALOG using the hyperlink button provided in the demo index.html page, but would like to open it on the page load. I read a couple links on StackOverflow (http://stackoverflow.com/questions/1611727/how-do-i-invoke-a-simplemodal-osx-dialog-on-page-load), but s...

Is there += for window.onload in Javascript ?

Hi everyone, recently I came up with the following problem: In my web site in all html pages I call a function in body onLoad event: <body onLoad="func1();"> This is part of my template for html, so it appears on every page in my site and I can't change that. Now, the deal is that on some pages, I need to call some other functions o...

Populating an object pool on JAR load

I have a core JAR that provides some functionality and hence used in lots of other apps as well - desktop apps, web apps etc. Now this core JAR maintains an object pool containing objects that are computationally expensive to create. The object pool is of fixed size and hence I create all of the objects at once and populate the pool. Wha...

How to open search result page in new window for javascript search engine which works in IE?

Check this http://javascript.internet.com/forms/multiple-search-engine.html page. I wonder how to open search result in new window which works for Internet Explorer. Also, how to set body onload for the searchbox. Please help me. This third times i asked but there's no expert able to solve this. Before this, an expert was sent a solution...

How can I ensure correct load of dynamic JavaScript files?

I have an app where generated HTML pages specify a single JavaScript file: <script language="JavaScript" src="/global.js"></script> In global.js is the following code, to load a single user-defined user.js file: var UserJsFile = document.createElement("script"); UserJsFile.type = "text/javascript"; UserJsFile.src = "/user.js"; docume...

Making an onchange event also run to pageload

Hi Guys, I have some onchange events setup in jQuery which are used to populate a select dropdown boxbased on what is selected in another select dropdown. I need these to also run on page load that so that results are returned based on what the first select box is at on page load (otherwise i endup with an empty select box). Ive had ...

javascript include function window.onload

I have 2 functions on a seperate page that I am including of the header of the .html page. Under the part where I include it, I have this code: window.onload = func1; I want to take that little snippet of code, and include it inside the included .js page which has the function in it, so essentially there will be the function, then righ...

Loading successive select boxes on startup with javascript

I am trying to populate select boxes from javascript at start up, with each one depending on the previous one. In HTML code I have <body onload="start_up()"> <span id="FirstList">xxxxxxx</span> <span id="SecondList">xxxxxxx</span> Javascript code is function start_up() { load_select('','Type1') load_select(document.getElem...

How do I avoid persisting data through ViewState for a child control in ASP.NET?

I have a control (say, a DataGrid or a ComboBox) which is a child of a user control. I want to DataBind it on every request, rather than have it's state persist through ViewState. I need to leave EnableViewState=true however. This means, I think, that I need to call DataBind before TrackViewState() is called. I read the fantastic blo...

Cant find appropriate doctype, only seems to work in quirks mode

For some reason my web page seems to work fine without a doctype, but doesnt if I specify any in full. I have gone through various different templates without any success, i.e. code validators then dont like my code and/or it doesnt work. The only thing "I get away with" is the top line below, but even then I cant specify any details, ...

iFrame src change event detection?

Assuming I have no control over the content in the iframe, is there any way that I can detect a src change in it via the parent page? Some sort of onload maybe? My last resort is to do a 1 second interval test if the iframe src is the same as it was before, but doing this hacky solution would suck. I'm using the jQuery library if it he...

onclick event not working after ie7 reload

I am using Javascript to dynamically create part of my page content. A routine that generates a set of img tags is called from the window.onload event. Those img tags are assigned attributes, including an onclick event. The img tags host thumbnail images that, when clicked, change the src property of the image in the main view div. E...

JSF action on page load

Hi, Is there a way to execute an action when a page is loaded? (Using JSF 1.2 with ICEFACES) Cheers. ...

window.onload seems to trigger before the DOM is loaded (JavaScript)

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't happening for me: I tried the following simple page in Chrome 4.1.249.1036 (41514) and IE 8.0.7600.16385 with the same result: both displa...

scrollTo scrolls to the top of the page

Hi, I have the following Javscript code. When the page is loaded it is scrolled to the right position. When I click on the link to run the function the page scrolls to the top of the page. Has anybody any idea how to fix it? <html> <head> <script type="text/javascript"> function scroll() { windo...

MVVM load data during or after ViewModel construction?

My generic question is as the title states, is it best to load data during ViewModel construction or afterward through some Loaded event handling? I'm guessing the answer is after construction via some Loaded event handling, but I'm wondering how that is most cleanly coordinated between ViewModel and View? Here's more details about my ...

How to get scrollTop of page just after page onload event?

I know how to get the scrollTop of a page, I use this simple JS function (code copied around): function GetScrolledTop() { //I never work in IE quirkmode, I always use DOCTYPE as 1st line, so I don't need to test for document.body.scrollTop return self['pageYOffset'] || document.documentElement.scrollTop; } This works and my p...

Firefox 3.6.x does not fire off my onload event

Hi, I have a Firefox 3.6.2 problem (3.5.x works just fine). This is the code: ... var newImage = new Image(); newImage.onload=function() {swapMapImg(newImage);}; newImage.src = newBackground; ... function swapMapImg(newImage) { alert('bingo'); } Firefox 3.6.2 no longer fires off my onload event, any ideas? ...

Using a bookmarklet to track a package

I'm trying to write a bookmarklet that tracks a package in the mail. First it checks to see if the tracking page is open, if not it opens it in a new tab, and then sets the value of the form to the tracking number. Finally, it submits the form. What I'm so far unable to do is set the value of the form in the case where the bookmarklet...