2013年6月30日 星期日

html meta (html header html meta setting)

html header meta setting 



Define keywords for search engines:
<meta name="keywords" content="free, example, make money , demo">

Define a description of your web page:
<meta name="description" content="Descript of your web page">



Define the author of a page:
<meta name="author" content="HongKong2000">

Refresh document every 5 seconds:
<meta http-equiv="refresh" content="5">

<meta http-equiv="Refresh" content="2;URL=http://hongkong2000.freehostia.com/">
停留2秒鐘後自動刷新到URL網址。

Charset setting. 
<meta http-equiv="content-Type" content="text/html; charset=gb2312">
ContentType選項: ("text/javascript","text/event-stream"); 
text/event-stream for server sent event (html5)
Charset選項:ISO-8859-1(英文)、BIG5、UTF-8等字符集;
Content-Language的Content還可以是:EN、FR等語言代碼。


<meta http-equiv="expires" content="Sun, 30 Jun 2013 18:00:00 GMT">
使用GMT的时间格式 。一旦網頁過期,必須到服務器上重新傳輸。


<meta http-equiv="Pragma" content="no-cache">
網頁不保存在緩存中,每次訪問都刷新頁面。這樣設定,訪問者將無法離線瀏覽。


<meta http-equiv="Window-target" content="_top">
強制頁面在當前窗口以獨立頁面顯示。這個屬性是用來防止別人在框架裡調用你的頁面。
Content選項:_blank、_top、_self、_parent。
 Metadata is data (information) about data.The <meta> tag provides metadata about the HTML document. Metadata will not be displayed on the page, but will be machine parsable.Meta elements are typically used to specify page description, keywords, author of the document, last modified, and other metadata.The metadata can be used by browsers (how to display content or reload page), search engines (keywords), or other web services.
<meta> tags always goes inside the <head> element.

元數據是關於數據的數據(信息)。<meta>標籤提供有關HTML文檔的元數據。元數據將不會被顯示在頁面上,但將機器的可解析。元元素通常用於指定頁面描述,關鍵字,文件作者,最後一次修改,和其他元數據。可以將元數據所使用的瀏覽器(如何顯示內容或重載頁面),搜索引擎(關鍵字),或其他網絡服務。總是<meta>標籤裡面的<head>元素。


The value of http-equiv varies depending on the way you use it. It may contain any of the following values:

    "Allow"
    "Content-Encoding"
    "Content-Language"
    "Content-Length"
    "Content-Type"
    "Date"
    "Expires"
    "Last-Modified"
    "Location"
    "Refresh"
    "Set-Cookie"
    "WWW-Authenticate"

java return set header when server sent event

response.setstatus(200)
response.setheader("cache-control","no-cache")
response.setheader("content-type","text/event-stream")
response.setheader("connection","keep-alive");


沒有留言:

張貼留言