question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

showFooter IE8 - Object expected error

See original GitHub issue

Using IE8 and setting showFooter = true; cause a javascript error.

Line 144 on:

var calculateObjectValue = function (self, name, args, defaultValue) {
        var func = name;

        if (typeof name === 'string') {
            // support obj.func1.func2
            var names = name.split('.');

            if (names.length > 1) {
                func = window;
                $.each(names, function (i, f) {
                    func = func[f];
                });
            } else {
                func = window[name];
            }
        }
        if (typeof func === 'object') {
            return func;
        } 

        // ERROR 
        if (typeof func === 'function') {
            
           // ERROR HERE
            return func.apply(self, args);   
        }


        if (!func && typeof name === 'string' && sprintf.apply(this, [name].concat(args))) {
            return sprintf.apply(this, [name].concat(args));
        }
        return defaultValue;
    };

This happends because apply(); function expects second parameter to be an array but undefined is given.

I solved this issue adding an extra control to if statement:

if (typeof func === 'function' && args !== undefined) {
       return func.apply(self, args);
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
wenzhixincommented, Feb 4, 2017

Thanks! Fixed this in develop branch

0reactions
vveliucommented, Feb 3, 2017

@wenzhixin just tested, this works too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Object expected" error using jQuery only in IE8 - Stack Overflow
The problem is that you haven't added jQuery into your code at all. Add the following inside the <head> tag: <script type="text/javascript" ...
Read more >
What is "Object Expected" error in Internet Explorer?
IE gives an error message "Object Expected" because it calls the function remoteFunction() prematurely. It calls before loading the file remote. js, which ......
Read more >
UI for ASP.NET MVC Q1 2016 - Telerik
Popup widget re-positions incorrectly when anchor is near the page bottom; IE8: JS error when kendo is loaded; firstDay should be Sunday in...
Read more >
Issues Addressed in SAS 9.4 (TS1M0)
Valuation fails with "ERROR: BY variables are not properly sorted on data set RD_STAGE.ISSUE_ASSET_MART. " 64-bit Enabled AIX, 64-bit Enabled ...
Read more >
script error object expected - Microsoft Community
I run windows 8.1 and quite often when opening up IE 11 I get a script error... usually object expected...I went to tools,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found