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

The Archive Base Latest Questions

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

I want a function to run when the document is ready , but there’s

  • 0

I want a function to run when the document is ready, but there’s no logical reason to leverage jquery as the little amount of work going on the page doesn’t warrant me loading a file of that size.

Typically I would use window.onload = function(){}; — as far as I can tell, this is the recommended approach.

Thoughts/recommendations? I would very much like to hear some developer opinions on this if there’s a better way.

Note-

If this question is better asked elsewhere (because it’s somewhat subjective) – please let me know and I’ll close it and ask there.

  • 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-26T00:07:53+00:00Added an answer on May 26, 2026 at 12:07 am

    The problem with window.onload is that it will wait for all content (like images) to be loaded. Typically you only need for the DOM to be ready to be manipulated. You should know though that jQuery eliminates a lot of the cross browser inconsistencies in doing that, and as such doing it yourself will be a small pain in the ass. For that reason, you might want to look into this library which contains the bare bones of cross-browser DOM readiness.

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

Sidebar

Related Questions

I have some javascript placed inside of the jquery $(document).ready function. It searches for
I only want this function to run if .toolbar li does not have the
I want to run function inside web service (.asmx file) $.ajax({ type: POST, contentType:
I have problem with fancybox. I want to write a function that will run
I have a C# application, and I want to run a function which is
I want to run a simple JavaScript function on a click without any redirection.
Want the function to sort the table by HP but if duplicate HPs then
$(document).ready(function() { $('#domain').change(function() { // }); }); The code inside the change function will
I want to have horizontal lists that can run as wide as possible but
This is my jQuery script: $(input[type=radio]:checked).live(click, function() { $(this).attr(checked,false); }); I want to make

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.