ล่าสุดการพัฒนาเว็บบทเรียน
×

JavaScript การอ้างอิง

ภาพรวม

JavaScript

JS เชือก JS จำนวน JS ผู้ประกอบการ JS งบ JS คณิตศาสตร์ JS วันที่ JS แถว JS บูลีน JS นิพจน์ทั่วไป JS สถานการณ์โดยรวม JS การแปลง

เบราว์เซอร์ BOM

Window Navigator Screen History Location

HTML DOM

DOM เอกสาร DOM องค์ประกอบ DOM แอตทริบิวต์ DOM เหตุการณ์ DOM รูปแบบ

HTML วัตถุ

<a> <abbr> <address> <area> <article> <aside> <audio> <b> <base> <bdo> <blockquote> <body> <br> <button> <canvas> <caption> <cite> <code> <col> <colgroup> <datalist> <dd> <del> <details> <dfn> <dialog> <div> <dl> <dt> <em> <embed> <fieldset> <figcaption> <figure> <footer> <form> <head> <header> <h1> - <h6> <hr> <html> <i> <iframe> <img> <ins> <input> button <input> checkbox <input> color <input> date <input> datetime <input> datetime-local <input> email <input> file <input> hidden <input> image <input> month <input> number <input> password <input> radio <input> range <input> reset <input> search <input> submit <input> text <input> time <input> url <input> week <kbd> <keygen> <label> <legend> <li> <link> <map> <mark> <menu> <menuitem> <meta> <meter> <nav> <object> <ol> <optgroup> <option> <output> <p> <param> <pre> <progress> <q> <s> <samp> <script> <section> <select> <small> <source> <span> <strong> <style> <sub> <summary> <sup> <table> <td> <th> <tr> <textarea> <time> <title> <track> <u> <ul> <var> <video>

วัตถุอื่น ๆ

CSSStyleDeclaration


 

Meta httpEquiv ทรัพย์สิน

อ้างอิงวัตถุ Meta วัตถุ Meta

ตัวอย่าง

กลับหัว HTTP สำหรับข้อมูลในส่วน content แอตทริบิวต์:

var x = document.getElementsByTagName("META")[0].httpEquiv;

ผลของ X จะเป็น:

content-type
ลองตัวเอง»

ความหมายและการใช้งาน

ชุดคุณสมบัติ httpEquiv หรือกลับหัว HTTP สำหรับข้อมูลในส่วน content แอตทริบิวต์

http-equiv แอตทริบิวต์สามารถใช้ในการจำลองการทำงานของส่วนหัวของการตอบสนอง HTTP

ค่าของ http-equiv แอตทริบิวต์ขึ้นอยู่กับค่าของ content แอตทริบิวต์

หมายเหตุ: ถ้า name แอตทริบิวต์ถูกตั้งค่า http-equiv แอตทริบิวต์ไม่ควรจะตั้ง


สนับสนุนเบราว์เซอร์

Internet ExplorerFirefoxOperaGoogle ChromeSafari

คุณสมบัติ httpEquiv ได้รับการสนับสนุนในเบราว์เซอร์ที่สำคัญทั้งหมด


วากยสัมพันธ์

กลับ 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";
ลองตัวเอง»

อ้างอิงวัตถุ Meta วัตถุ Meta