Thursday, September 24, 2009

META http-equiv Auto Refresh every 10 second

Meta Object
It represents an HTML element.
It is a element provides meta-information about a HTML document (descriptions and keywords for search engines and refresh rates).

Meta Object have 4 properties:
content - set or get a value (any text)
httpEquiv - Connect to http header (content-type, expires,refresh,set-cookie)
name - name of attribute (author,description,keywords,generator,etc)
scheme - format for the attribute value

Example below show you the using of http-equiv,content and name
Below example will show automatic refresh the page every 10 seconds.
Http-equiv="refresh" will do the refresh action and content=10 is telling
http-equiv to do the refresf after every 10 seconds.

If you need to test it, you just copy and paste to ur file and run it.

<head>
<meta http-equiv="refresh" content="10" />
<meta content='programmingschools,Javascript, asp net programming,' name='keywords' /> </head>
<script type="text/javascript">
now = new Date();
hour = now.getHours();
min = now.getMinutes();
sec = now.getSeconds();
document.write(hour + ":" + min + ":" + sec );
</script>
<body>
</body>

No comments: