Call javascript after page load

By , July 24, 2009 8:00 pm

Recently I required to call a function after a page load in my project.

onLoad event is available in html but not like afterLoad or offLoad event in html.

I found  one of the easiest  solution. Just call a function at end of the page.  :)


<html>

<body>

.....

<script>function_name();</script>

</body>

</html>

Is that so simple?

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Webnews
  • Digg
  • del.icio.us
  • Reddit
  • Bloglines
  • LinkedIn
  • YahooMyWeb
  • Facebook
  • Google Bookmarks
  • Mixx
  • MySpace
  • Technorati
  • TwitThis

3 Responses to “Call javascript after page load”

  1. googenot says:

    It works, and it’s really so simple. Thanks a lot!
    I’ve tried to call this script within form tags with no effect. I tried some more sophisticated methods with no success, but things tuned out to be so simple. Good.

  2. David Brennan says:

    Thats brilliant I am using a child page and all the usual stuff didnt apply. I used ur code to pass the count of a grid to an external js function.The function checks the count and if < 1 hides a html button.

    HideControls(”);

    Great stuff thanks man

  3. Sandip says:

    It solved my problem.Thanks a lot. :)

Leave a Reply

*

Panorama Theme by Themocracy