webview載入gif圖片
阿新 • • 發佈:2019-01-25
下面是index.htmlx介面程式碼
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> </head> <body> <nav title="webview和html互相呼叫"></nav> <webview id="webview" width="100%" height="100%" url="local://html/my.htm" /> </body> <script> //webview呼叫html裡面的方法 webview.addEvent("onFinished" , function(){ webview.execute("changeLabelValue()"); }) webview.addEvent("onFailured" , function(){ }) function click1(data){ //html傳過來的中文會出現亂碼,所以使用解碼方法進行解碼 var string = decodeURIComponent(data); alert(string) } </script> </html>
點選可以下載gifDemo.zip示例demo