开发者

Refresh content of html file inside an uiwebview (iphone)

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜