0

Every time when I try to run this code in visual studio I get the above error. I am not sure what is going on. I know it's question like this, but I did not see this error in the answered in the solutions to this problem. Can anyone help me with this?

// display the lightbox
function lightbox() {
    var insertContent = "<div id='chartCon'>Test</div>";
    // jQuery wrapper (optional, for compatibility only)
    (function ($) {

        // add lightbox/shadow <div/>'s if not previously added
        if ($('#lightbox').size() == 0) {
            var theLightbox = $('<div id="lightbox" class="highcharts-container"/>');
            var theShadow = $('<div id="lightbox-shadow"/>');
            $(theShadow).click(function (e) {
                closeLightbox();
            });
            $('body').append(theShadow);
            $('body').append(theLightbox);
            //$().keydown(function (e) {
            //    if (e.which == 27) {
            //        closeLightbox();
            //    }             
            //});
        }

        // remove any previously added content
        $('#lightbox').empty();

        // insert HTML content
        if (insertContent != null) {
            $('#lightbox').append(insertContent);
        }

        //create chart
        var chart = $('#ChartContainer').highcharts('StockChart');
        var annots = chart.exportData()
        window.chartwidth = $('#ChartContainer').width();
        //chart.destroy();
        window.chartops.series = window.seriesOptions;
        $('#lightbox').highcharts('StockChart', window.chartops);
        $('#lightbox').highcharts('StockChart').importData(annots);

        // move the lightbox to the current window top
        $('#lightbox').css('top', $(window).scrollTop());

        // display the lightbox
        $('#lightbox').show();
        $('#lightbox-shadow').show();

    })(jQuery); // end jQuery wrapper

}

// close the lightbox
function closeLightbox() {

    // jQuery wrapper (optional, for compatibility only)
    (function ($) {

        //export possibly changed annotations and reset chartwidth
        var chart = $('#lightbox').highcharts('StockChart');
        var annots = chart.exportData()

        $('#ChartContainer').highcharts('StockChart').removeAllAnnotations();
        $('#ChartContainer').highcharts('StockChart').importData(annots);
        window.chartwidth = $('#ChartContainer').width();

        // hide lightbox/shadow <div/>'s
        $('#lightbox').hide();
        $('#lightbox-shadow').hide();

        // remove contents of lightbox in case a video or other content is actively playing
        $('#lightbox').empty();

    })(jQuery); // end jQuery wrapper

}    
5
  • 2
    sigh What line is the error reported on? Commented Nov 12, 2014 at 17:48
  • It's giving me an error in another file called minInput.blur();. If that helps, If not maybe I can try and show the other file where the error is? Commented Nov 12, 2014 at 17:52
  • 1
    @user3784911 yes in general showing code relevant to the error helps a bit more Commented Nov 12, 2014 at 20:25
  • var minInput = rangeSelector.minInput, maxInput = rangeSelector.maxInput; if (minInput) { minInput.blur(); } if (maxInput) { maxInput.blur(); } }; Commented Nov 14, 2014 at 21:48
  • That is the section given me the error. Commented Nov 14, 2014 at 21:48

1 Answer 1

1

Sorry, this is the function giving me the error

init: function (chart) {

        var rangeSelector = this,
            options = chart.options.rangeSelector,
            buttonOptions = options.buttons || [].concat(rangeSelector.defaultButtons),
            selectedOption = options.selected,
            blurInputs = rangeSelector.blurInputs = function () {
                var minInput = rangeSelector.minInput,
                    maxInput = rangeSelector.maxInput;
                if (minInput) {
                    minInput.blur();
                }
                if (maxInput) {
                    maxInput.blur();
                }
            };
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.