This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Javascript called with some delay Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Javascript called with some delay" Watch "Javascript called with some delay" New topic

Javascript called with some delay

Ganesan Ramakrishnan
Ranch Hand

Joined: Mar 18, 2008
Posts: 88

I hava an issue in my javascript function which is called from body onload of the window.
actualy inside the javascirpt, i am diabling the button, which is in centre of the window.
after i am displaying some list of images.
my problem is , the button disabled only after load the all images in bottom of the screen
i want to disable the button before full screen loaded.

anybody help me to solve this issue?

Vinod Tiwari
Ranch Hand

Joined: Feb 06, 2008
Posts: 459
Please post your JS funtion for us to help.

Vinod Tiwari | Twitter
Rob Crowther
Ranch Hand

Joined: Nov 06, 2012
Posts: 295

You need DOMContentLoaded instead of load. Or you could use jQuery $(document).ready() which will take care of compatibility with older browsers.

Read my books: Hello! HTML5 & CSS3 | HTML5 in Action | Read my blog
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60766

If the button is to always be disabled upon load, why are you using JavaScript at all? Just mark the button as disabled in the markup.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
jQuery in Action, 2nd edition
subject: Javascript called with some delay
Similar Threads
Session.invalidate() and Logout
Embedded JSP component in JavaScript pop up page.
Closing child window after executing Action
window.opener performance error
Child windows not getting closed