Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ibm mobilefirst IBM Worklight-BusyIndicator文本值不能用变量替换?_Ibm Mobilefirst_Worklight Runtime - Fatal编程技术网

Ibm mobilefirst IBM Worklight-BusyIndicator文本值不能用变量替换?

Ibm mobilefirst IBM Worklight-BusyIndicator文本值不能用变量替换?,ibm-mobilefirst,worklight-runtime,Ibm Mobilefirst,Worklight Runtime,我试图用一个变量替换busyindicator构造函数中的文本值,而不是对其进行硬编码。但由于某些原因,应用程序无法理解变量 function wlCommonInit(){ var locale = "Caricamento"; var busyIndicator = new WL.BusyIndicator('content',{text:locale}); busyIndicator.show(); } 需要一个字符串,因此不能放置变量 相反,请使用WL.Cli

我试图用一个变量替换busyindicator构造函数中的文本值,而不是对其进行硬编码。但由于某些原因,应用程序无法理解变量

function wlCommonInit(){
    var locale = "Caricamento";
    var busyIndicator = new WL.BusyIndicator('content',{text:locale}); 
    busyIndicator.show();
}
需要一个
字符串
,因此不能放置变量

相反,请使用
WL.ClientMessages
。例如:

var busy;

function wlCommonInit(){
    WL.ClientMessages.loading = "טוען...";
    busy = new WL.BusyIndicator();
    busy.show();
}

阅读材料:

  • 培训模块,幻灯片#8

Idan,这很好用。。由于它是一个JSON对象,我假设一个普通的键值对应该可以工作,但现在使用WL.ClientMessages来实现同样的功能