开发者

Refresh content of html file inside an uiwebview (iphone)

开发者 https://www.devze.com 2023-02-06 10:37 出处:网络
I loading a simple html file inside the UIWebView. This html contains a single image of a Webcam. <img id=\"image\" src=\"http://server.tld/lastwebcamimage.jpg\" width=\"300\" height=\"245\" />

I loading a simple html file inside the UIWebView. This html contains a single image of a Webcam.

<img id="image" src="http://server.tld/lastwebcamimage.jpg" width="300" height="245" />

Now I want to refresh this htmlfile/image every 6 seconds, and display the updated webcam image.

I tried:

<meta content="no-cache" http-equiv="cache-control">
<meta content="no-cache" http-equiv="pragma">
<meta content="6" http-equiv="refresh">

AND

<script type="text/javascript">
    var active = window.setInterval("开发者_Python百科reloadMe()", 6000);
    function reloadMe() {
        window.location.reload()
    }
</script>

but it doenst work. Any other knows ways to refresh the page?

Thx.


Schedule an NSTimer to fire every 6 seconds and call -[UIWebView reload].

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号