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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:20:00+00:00 2026-05-22T17:20:00+00:00

I have a JavaScript web application which, when being initialized, takes a chartType parameter.

  • 0

I have a JavaScript web application which, when being initialized, takes a chartType parameter. The chartType value (for example “populationPyramid” or “scatterGram”) should determine the layout state of the app. In “populationPyramid mode”, the app should for example have a small sidebar view and an extra heading view. (All in all there might be 4 different layouts of the app with their own css settings.)

Let’s say the populationPyramid has a model, a controller and a number of views that each should have its own div container.

1) How do I easily inject the necessary html when initing the application or when changing state? Can JavaScript templates help me?

2) And how do I handle window.resize events on a per view basis?
thanks.

  • 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-22T17:20:00+00:00Added an answer on May 22, 2026 at 5:20 pm

    Try a clientside MVC framework such as backbone or spine.

    You can use a hashbang url routing system to change your “page” or “layout” for each chart.

    You can use templates/views to render your page/layout and you can use models in JavaScript to hold all your state.

    1. When you initialize the application you simply grab some data through your ajax connection, store it in your model and then render it through your view. When your router detects a hashbang url page change you get some different data through ajax and render that instead.

    2. Your deconstructors on your model/views should remove events. So whenever you create a new client side view you rebind specific events for that view.

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

Sidebar

Related Questions

I have a web-based application which is very highly reliant on jquery / javascript,
I have a one page web application, which means alot of javascript. External scripts
I have a sorta unique question. There is a web application which takes 5.57mbs
I have a web application written in pure JavaScript (no pre-generated HTML except for
I have a web application that uses TONS of javascript, and as usual, there
Here's the situation: I have a web application which response to a request for
I have to write a web application, and I am not sure which technology
I have a callback function within an ASP.NET Web Forms application which I am
We have an ASP.NET web application which uses ASP.NET Ajax. We open it from
I have created an ASP.NET Webforms web application which basically inetracts with the code

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.