2014-11-24 24 views
0

我試圖顯示一個BusyIndi​​cator,但是當我運行該項目時它不顯示。 這是我的main.js:IBM Worklight:BusyIndi​​cator未顯示

var busyInd; 

function wlCommonInit() { 
    busyInd = new WL.BusyIndicator('content', {text : 'Loading...'}); 
    mostraDialogo(true); 
} 

function mostraDialogo(on) { 
    if (on) 
     busyInd.show(); 
    else 
     busyInd.hide(); 
} 

怎麼了?

+0

Worklight版本?你在嘗試使用哪種移動操作系統? – 2014-11-24 15:52:30

+0

工作燈6.2。我正在嘗試在移動瀏覽器模擬器上。 – 2014-11-24 15:56:35

+0

移動瀏覽器模擬器不是移動操作系統。在MBS中預覽哪個操作系統? – 2014-11-24 15:58:35

回答

1

您的HTML中可能沒有content ID。

我把它換成

busyInd = new WL.BusyIndicator('content', {text : 'Loading...'}); 

隨着

busyInd = new WL.BusyIndicator(null, {text : 'Loading...'}); 

,我可以看到忙碌的指標。
我還爲HTML添加了一個帶有content ID的DIV,並且它也可以工作。

在實際設備或模擬器/仿真器中測試時,ID參數不是必需的,因爲它使用本機忙指示符。在MBS中測試時,ID參數是必需的,因爲使用了Web忙碌指示符,並且它必須錨定到現有元素(或爲空)。

+0

現在有效。感謝您的解釋。 – 2014-11-24 16:08:06

相關問題