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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:18:35+00:00 2026-05-14T00:18:35+00:00

What is the best practice is in the case of altering the render order

  • 0

What is the best practice is in the case of altering the render order of elements on a webpage. For example, I have two DIVs that are to be displayed on a page:

<div id="appleSection" class="appleStyle">
    <!-- Apple DIVs, content, form elements, etc -->
</div>

<div id="orangeSection" class="orangeStyle">
    <!-- Orange DIVs, content, form elements, etc -->
</div>

Depending on user selection (perhaps by country or something), the order which the DIVs are presented to the user can differ when the user changes their selected country. Certain country selections present the appleSection above orangeSection, and for other selections, their order is reversed.

If the core logic of the page is the same regardless, is it a best practice to determine order on the server-side (perhaps via two pages that differ in the order of the DIVs), or is it more appropriate to have just a single page and use CSS to control whether appleSection is above orangeSection or vice versa?

  • 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-14T00:18:35+00:00Added an answer on May 14, 2026 at 12:18 am

    Does the order of the selections have to change instantaneously? As in, does it have to change when the user selects a country? Or is it pre-rendered?

    If it is the latter, I would do it from the server-side. I’d send in a flag of some sort. Assuming you are using JSTL or ASP or something you can control the order based on the value of the flag. I think two pages to do the same thing isn’t a good idea because that is significant duplication of code.

    If it has to change based on user interaction, I would use something like jQuery along with the appropriate CSS (change the classes using jQuery based on user input).

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

Sidebar

Related Questions

What would be considered best practice in this case. I've got a class that's
Is it correct/ a best practice to have a commonBean for operations that are
What would be the best practice for sharing localization object (in this case ResourceBundle,
The best practice seems to be to use assert for a condition that should
I am working with URLLoader and URLRequest in this case. I have two buttons.
I have two web services , with little bit different API for example :
Which is best practice (in this case): bool Foo::operator==(const Foo& other) { return bar
Is there a best case practice for validating when using a templating engine? I'm
I have a quick question on best practice and if getters and setters are
I want to know what's the best practice for the following case : I'm

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.