Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 610871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:43:20+00:00 2026-05-13T17:43:20+00:00

I have recently found myself playing around with events, and as there is no

  • 0

I have recently found myself playing around with events, and as there is no standard for the event indicating that a page has been loaded (like onload vs. pageshow) I wondered whether something speaks against simply putting some JavaScript at the end of the page. This code would then be executed when the page is loaded.

In this example I would add a keyUp listener to the (input) element identified by iText and assign it to the function updateText(event) (the event object will be passed on to this function).

<html><head></head><body>
<!-- content -->
<script type="text/javascript">
    document.getElementById('iText').onkeyup = updateText;
</script>
</body>
</html>

Sample page here:
http://kb.granjow.net/JavaScript/onload.html

Tested in Firefox 3.5, Opera 10.10, IE 6, IE 8, working everywhere.

So, is this good or did I miss something?

Looking forward to your answers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:43:21+00:00Added an answer on May 13, 2026 at 5:43 pm

    This would be fine for basic pages. However, if your script dealt with images that hadn’t finished downloading or results from ajax requests you might run into trouble. If you’re handcoding things, something like this should work:

    function registerEvent(el, event, func, bCapture)
    {
        if (el.attachEvent)
            el.attachEvent('on'+event, func);
        else if (el.addEventListener)
            el.addEventListener(event, func, bCapture);
    
    }
    

    Otherwise, the various JS libraries each have their own implementation such as jQuery’s $(document).ready().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently found out that there exists a method called nth_element in the
I have recently found out that the future of Qt has become uncertain as
I have recently found myself becoming more negative about EF and cannot help wondering
I have recently found out that no argument constructor and multiple argument constructor cannnot
I am a windows dev, but I have recently found that I need to
I have a project that uses JQuery-UI. I recently found formee, which is a
Recently I have been learning about WMI and WQL. I found out the list
We've recently upgraded one of our SSRS2005 servers to SSRS2008 and have found that
I have recently found myself in the position of explaining an (In-House) application I
I use a cluster of about 30 machines that have all recently been reconfigured

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.