簡體   English   中英

MFP 8.0遷移| WL.Client.setHeartBeatInterval函數不起作用

[英]MFP 8.0 Migration | WL.Client.setHeartBeatInterval function not working

我從下面的URL下載了MFP 6.3示例項目,然后遷移到MFP 8.0

https://mobilefirstplatform.ibmcloud.com/tutorials/zh-CN/foundation/6.3/working-offline/working-offline/

function wlCommonInit(){    
    document.addEventListener(WL.Events.WORKLIGHT_IS_CONNECTED, connectDetected, false); 
    document.addEventListener(WL.Events.WORKLIGHT_IS_DISCONNECTED, disconnectDetected , false);
}

function connectionFailure(){
    alert("Could not connect to the MobileFirst Server.");
    var output = new Date() + "<hr />Working offline";
    $('#info').html(output);
}

function disconnectDetected(){
    var output = new Date() + "<hr />disconnectDetected";
    $('#info').html(output);
}

function connectDetected(){
    var output = new Date() + "<hr />connectDetected";
    $('#info').html(output);
}

function setHeartBeatInterval(interval){
    var output = new Date() + "<hr />heartbeat interval is set to: " + interval;
    $('#info').html(output);
    WL.Client.setHeartBeatInterval(interval);
}

WL.Client.setHeartBeatInterval函數。 但是在MFP 8.0中未觸發WORKLIGHT_IS_CONNECTED, WORKLIGHT_IS_DISCONNECTED事件。

WL.Client.setHeartBeatInterval是否有效?

WL.Client.setHeartBeatInterval自MFP 8.0起有效,並且運行良好。API詳細信息在此處

這些事件不再有效。 您可以添加自定義事件偵聽器並檢查連接性。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM