预期 ,但在具有默认参数的 NetBeans for JS 函数的警告中找到 =


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
}

在 Netbeans 中收到警告 - 预期 ,但已找到 = 有什么更好的方法吗?

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
}
}

像这样更改函数解决了问题

最新更新