Hi
following is my current code, Using B4j to refresh browser side page data every fixed timimg with websocket.
My new application is, How could i refresh page with ajax/get to B4J in fixed timing from browser, I don't use websocket ?
B4J
Browser
following is my current code, Using B4j to refresh browser side page data every fixed timimg with websocket.
My new application is, How could i refresh page with ajax/get to B4J in fixed timing from browser, I don't use websocket ?
B4J
B4X:
Sub timer2_tick
dim data As Map
data.Initialize
data.Put("resultc",plc.resultc) ' 結果顏色
data.Put("resultn",plc.resultn) ' 結果數值
'
ws.RunFunction("refresh_page",Array As Object(data))
ws.Flush
End Sub
Browser
B4X:
function refresh_page(io)
{
graphic.setValue('resultc',io.resultc);
graphic.setValue('resultn',io.resultn);
};