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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:10:42+00:00 2026-05-26T19:10:42+00:00

I am having a weird problem that I hope you can help me with.

  • 0

I am having a weird problem that I hope you can help me with.

I have Highcharts running on a dev website — I use a simple form to allow the user to enter data.

On the same page, a Highchart shows once data is entered.

The data entry form has very simple jQuery-based snippets, eg. form validation, a counter for max number of characters, etc.

What happens is that when there is chart data in the database, the chart plots correctly, and the remaining JS snippets work as expected wen you try to enter new datapoints.

But if there is no data in the database (therefore no Highchart is shown), all my JS snippets stop working.

On Firebug console, I get this error when there is no data to form a chart:

jb is null
function n(m,h){kc=ya(a.title,m);tc=ya...play:""});Aa.body.appendChild(Qb)}Tc=
highcharts.js (line 47)

On Chrome, a different error shows as

Uncaught TypeError: Cannot set property 'innerHTML' of null
d.d.extend._Deferred.f.resolveWith         jquery.min.js:16
d.d.extend.ready                           jquery.min.js:16
d.c.addEventListener.A

Again, these errors disappear as soon as I enter the first data point and a chart is formed.

Does anyone know what is happening and how I can get my JS to work when a Highchart is empty?

Any pointers are much appreciated. 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-26T19:10:42+00:00Added an answer on May 26, 2026 at 7:10 pm

    OK, this error popped up again and that’s because my comment above did not really solve it.

    Here’s the culprit: if you have a model that generates data for charts happen to return an empty array (say it’s a new user and she hasn’t added any data yet to the database), this empty array is passed to the controller — which will then pass the empty array to the view with Highcharts.

    When passing an empty array to my view containing Highcharts, Highcharts would run but would not find an element to inject the chart, because I also had a condition in the view that removed #container if there was no data.

    Without where to put the chart, Highcharts returns an innerHTML error, that may or may not break your remaining javascript (my case).

    The solution here had nothing to do with JS, but actually with putting a condition in my controller which would be in pseudo code:

    if model that generates chart data returns empty array
        don't generate view containing Highcharts
    else
        generate view containing Highcharts
    

    Doing this not only I prevented the error for good but also reduced the overhead of running Highcharts when no data is present.

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

Sidebar

Related Questions

This is a really weird problem that I have been having. When I download
i'm having an weird problem, my project have a login page, that's working, but
Having a weird problem here. Everybody knows that if you use web.config's customErrors section
I'm having a very weird problem that for the life of me I can
I'm having a weird problem. I have a div that is hidden via css
I'm having the weird problem that after having javascript inject some dom-elements the css-rules
I'm having a weird problem with memset, that was something to do with a
I'm having a weird problem with index organized table. I'm running Oracle 11g standard.
This is a weird problem I have started having recently. My team is developing
all. I'm having a bit of weird problem with client server program. I have

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.