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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:04:57+00:00 2026-05-22T03:04:57+00:00

SHORT: my python code generates a webpage with a table. i’m considering rewriting it

  • 0

SHORT: my python code generates a webpage with a table. i’m considering rewriting it to generate a js file instead, that holds the table contents in an array … and then let the table be generated client-side. I am not sure of the pros and cons. Anyone care to offer their experience/insight? Are there other solutions?

LONG: the web page contains a single table and an embedded gmap. the table is a set of locations with several columns of location-stats and also two navigation columns. one nav column consists of onclicks that will recenter embedded gmap to the lat,lon of the location. the other nav column consists of hrefs that open a new window with a gmap centered on the lat,lon.

Until recently, my python code would do some number crunching on a list of files, and then generate the html file. also i wrote a js file that keeps the webpage liquid upon browser window resizing.

Recently, I modified my python code so that it:

  1. placed the lat,lon info in a custom attribute of the tr elements
  2. no longer produced the nav column tds

and then wrote a js function that

  1. loops through the trs onLoad
  2. reads the lat,lon from the custom attribute
  3. inserts the nav tds

fwiw, this reduced the size of the html file by 70% while increasing the js by 10%.

ok, so now I am debating if I should go all the way and write my python code to generate 2 files

  1. an essentially abstract html file
  2. a js file containing a js array of the locations and their stats
  • 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-22T03:04:58+00:00Added an answer on May 22, 2026 at 3:04 am

    If your API can output a JSON document with your data, you gain significant flexibility and future-proofing. This might even be something your users will want to access directly for their own external consumption. And of course your JS code can easily generate a table from this data.

    However nobody here can tell you whether this is worth doing or not, as that depends entirely on the scope of your project and opportunity cost of time spent re-architecting.

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

Sidebar

Related Questions

I have a working python 2.7 program that calls a DLL. I am trying
I must use goto in Python. I found entrians goto but my Python implementation
My code so far: // The q constant of the Glicko system. var q
This question originated when I came upon ( another thread ) about Python's datetime
I'm trying to setup ipython.el in emacs23. I've successfully installed it (after putting python-mode.el
I'm trying to find comment blocks in PHP source code using regular expressions in
I'm relatively new to python and know very little syntax, but I'm willing to
We manage a site for a medical charity. They have a number of links
I have a login.jsp page which contains a login form. Once logged in the
I'm working on a project in C# w/ XNA, and I want to reorganize

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.