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 148027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:53:07+00:00 2026-05-11T08:53:07+00:00

I am refactoring a page that uses <body onload=myJS();> to a user control. I

  • 0

I am refactoring a page that uses <body onload='myJS();'> to a user control. I understand I can do it using server side script registration on load.

If I want to do it on the client side (ascx), how would I do this?

  • 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. 2026-05-11T08:53:07+00:00Added an answer on May 11, 2026 at 8:53 am

    Taken from http://snipplr.com/view/3116/cross-browser-add-event-listener/

    // Cross-browser implementation of element.addEventListener()  function addEvent(evnt, elem, func) {     if (elem.addEventListener) // W3C DOM         elem.addEventListener(evnt,func,false);     else if (elem.attachEvent) { // IE DOM         var r = elem.attachEvent('on'+evnt, func);      return r; } 

    Use it like this: addEvent(window, your_onload_handler). Or you could just use jquery for this and a lot of other things.

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

Sidebar

Related Questions

I have a simple image upload script that uses SimpleImage.php (http://www.white-hat-web-design.co.uk/blog/resizing-images-with-php/) to resize and
Whilst refactoring some old code I realised that a particular header file was full
While refactoring code and ridding myself of all those #defines that we're now taught
Whilst refactoring some legacy C++ code I found that I could potentially remove some
Whilst refactoring some code I came across some getter methods that returns a std::string.
I recently did some refactoring of my mvc application and realized that there are
I just inherited an ASP.NET WebForms web application that I was tasked with refactoring.
I've been tasked with porting/refactoring a Web Application Platform that we have from ASP.NET
I've got a web page where I need a user to click the save
I'm reading through the Source Making site, specifically the Refactoring section. On the page

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.