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]
.
精彩评论