0
function my_check_request(comp,load='')
{
    if(load==''){
        var btn = jQuery(comp).button('loading');
        //i will do something here
    }
    else{
        jQuery(comp).css("display", "inline");
        //i will do something here
    }

Getting the warning in Netbeans - expected , but found = Any better way for this?

2
  • 1
    Function default parameters is ES6+, try changing the JsLint to ES6. Commented Aug 8, 2017 at 7:48
  • If you can't use ES6, then maybe change load='' to load in the function declaration and add the following line: load = (typeof load !== 'undefined') ? load : ''; within the function body. Commented Aug 8, 2017 at 7:50

1 Answer 1

1
function my_check_request(comp, load)
{
    load = load || '';
    if (load == '') {
        var btn = jQuery(comp).button('loading');
        //i will do something here
    } else {
        jQuery(comp).css("display", "inline");
        //i will do something here
    }
}

Changing the function like this resolved the issue

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.