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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:33:54+00:00 2026-06-10T12:33:54+00:00

I am using highcharts in my page. It’s sort of heavy. When user clicks

  • 0

I am using highcharts in my page. It’s sort of heavy.

When user clicks on a button, it loads the highcharts dynamically and when user clicks on close button, it removes/hides the chart.

I want to know which one would be a better option.

  1. Hiding the chart when user clicks ? Will it slow down the rest of the page (as heavy javascript along with handlers is present ?) or,

  2. remove() it, so that it makes the page lighter (But here, when user clicks on button again, I need to load the charts again) or,

  3. Use detach() , so that on reloading the highcharts, it works faster
    than remove() (but wont it make the page heavier as jQuery
    handlers are present all the time ?)

I know from the jQuery docs,

.remove()

the .remove() method takes elements out of the DOM. Use .remove() when
you want to remove the element itself, as well as everything inside
it. In addition to the elements themselves, all bound events and
jQuery data associated with the elements are removed.

.detach()

The .detach() method is the same as .remove(), except that .detach()
keeps all jQuery data associated with the removed elements. This
method is useful when removed elements are to be reinserted into the
DOM at a later time.

.hide()

The matched elements will be hidden immediately, with no animation.
This is roughly equivalent to calling .css(‘display’, ‘none’)

  • 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-06-10T12:33:55+00:00Added an answer on June 10, 2026 at 12:33 pm

    If you just want to hide/show an object from time to time, then use jQuery .hide() and .show(). It’s simplest and as long as you were going to keep the object around anyway, you may as well just use .hide() and .show(). Unless the object consumes massive amounts of memory, it shouldn’t be an issue.

    .remove() (while saving and then reinserting the same object back in the DOM later) will be of little use to you because it destroys some of the data associated with the object so you may not be be able to easily reinsert it in the page.

    .remove() where you actually let the previous object gets destroyed by the garbage collector and then you recreate it from scratch when needed again is the most memory efficient operation, but unless it consumes a lot of memory or you have a lot of them (e.g. thousands), it’s probably just more work to do it this way without any meaningful benefit.

    .detach() (while saving and then reinserting the same object back in the DOM later) will work, but it’s more work than .hide() and .show() and, in all honesty, I rather doubt you will find a difference between the two options.

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

Sidebar

Related Questions

I am using Highcharts to draw a line graph. When the page loads, the
i'm using Highcharts , the chart result is a collection of SVG elements and
We are using highcharts and are trying to customize a chart to look similar
I want to add a background image to a bar chart using Highcharts and
I'm using the HighCharts library to create a chart and then update it via
I am using HighCharts together with Python to dynamically create charts. All works fine,
I'm trying to load a chart using HighCharts. I've created a function that takes
I'm trying to display a chart titled Purchases over Time using Highcharts in my
I'm working on a Bubble Chart using Highcharts. Here's a sample of my data:
I'm trying to make a dynamic chart using HighCharts, but as it seems to

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.