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

  • Home
  • SEARCH
  • 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 1046185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:06:21+00:00 2026-05-16T16:06:21+00:00

I have acquired the task of updating some horribly outdated JavaScript code which I

  • 0

I have acquired the task of updating some horribly outdated JavaScript code which I did not write, full of hacks and pitfalls, sparse in comments. In addition to making the change work, I’d like to make the script easier to understand and more robust (e.g. not using global variables).

I think I’ve been able to wrap my mind around most of its execution, so I think I’m ready to begin making changes on it.

My question is: which limited time, which pieces should I prioritize changing? Should I first try to encapsulate everything in namespaces? Should I create classes for all of my objects? Should I replace all .innerHTML calls with their DOM equivalents? Should I “use jQuery”? Which pieces do you think are most important to have in order to maximize the improvements to the code?

  • 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-16T16:06:22+00:00Added an answer on May 16, 2026 at 4:06 pm
    1. Get cross browser hacks out of your code. It doesn’t matter which library you use for that, but they’re going to do it better than you. The most important here is probably cross browser event handling, but there are some other DOM issues, and using something like jQuery can really get rid of some boilerplate stuff.
    2. If the code is using innerHTML, then it’s probably also generating html strings. innerHTML is really not a bad thing as much as generating the html for it can be very ugly. Look into a simple JS templating solution.
    3. Along the way towards doing the first two, you’ll probably find that it makes sense to make the code more object-oriented/namespaced, and you can probably do it as you go. If there’s anything left, though, you can do it when the others are done.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 514k
  • Answers 514k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Sort of a HTML: <input type="text" name="url" id="url"/> <input type="submit"… May 16, 2026 at 6:13 pm
  • Editorial Team
    Editorial Team added an answer Yes..sox has support for mp4, m4p, & m4a. They're marked… May 16, 2026 at 6:13 pm
  • Editorial Team
    Editorial Team added an answer $('select#xyz option:not(:selected)'); or $('#mySelect option').not(':selected'); May 16, 2026 at 6:13 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Task at hand — I have three versions of some code, developed by different
I have a workflow, which creates a task and deletes it after the task
The task was to bypass login form on remote server with a session_id acquired
My co-worker is using a third-party .NET library for which we don't have the
I have a queue of task in java. This queue is in a table
I have an archive object which manages various byte arrays and hands out InputStream
I have acquired a subversion repository. The problem with it is that everything is
So I have acquired the element I want, but I want to check the
I have a data of Element class. I'm trying to write its values to
I have a bunch of different methods that are not supposed to run concurrently,

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.