मेटा httpEquiv संपत्ति
उदाहरण
सामग्री विशेषता में जानकारी के लिए HTTP शीर्षलेख लौटाएं:
var x = document.getElementsByTagName("META")[0].httpEquiv;
परिभाषा और उपयोग
httpEquiv गुण सामग्री विशेषता में जानकारी के लिए HTTP शीर्षलेख सेट या लौटाता है।
HTTP-equiv विशेषता का उपयोग HTTP प्रतिक्रिया शीर्षलेख को अनुकरण करने के लिए किया जा सकता है।
http-equiv विशेषता का मान सामग्री विशेषता के मान पर निर्भर करता है।
नोट: यदि नाम विशेषता सेट है, तो http-equiv विशेषता सेट नहीं की जानी चाहिए।
ब्राउज़र समर्थन
Property | |||||
---|---|---|---|---|---|
httpEquiv | Yes | Yes | Yes | Yes | Yes |
वाक्य - विन्यास
httpEquiv प्रॉपर्टी लौटाएं:
metaObject.httpEquiv
httpEquiv प्रॉपर्टी सेट करें:
metaObject.httpEquiv = HTTP-header
आमतौर पर इस्तेमाल किए जाने वाले कुछ HTTP-हेडर मान हैं:
Value | Description |
---|---|
content-type | Specifies the character set for the contents of the document. Tip: It is recommended to always specify the character set. Example: <meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
default-style | Specifies the preferred style sheet to use. Example: <meta http-equiv="default-style" content="the documents preferred stylesheet"> Note: The value of the content attribute above must match the value of the ttitle attribute on a link element in the same document, or it must match the value of the title attribute on a style element in the same document. |
refresh | Defines a time interval for the document to refresh itself.
Example: <meta http-equiv="refresh" content="300"> Note: The value "refresh" should be used carefully, as it takes the control of a page away from the user. Using "refresh" will cause a failure in W3C's Web Content Accessibility Guidelines. |
प्रतिलाभ की मात्रा
Type | Description |
---|---|
String | Information about the HTTP response message header |
और ज्यादा उदाहरण
उदाहरण
http-equiv और सामग्री विशेषताओं का मान बदलें। निम्न उदाहरण दस्तावेज़ को हर 30 सेकंड में ताज़ा करेगा:
document.getElementsByTagName("META")[0].httpEquiv = "refresh";
document.getElementsByTagName("META")[0].content = "30";
❮ मेटा ऑब्जेक्ट