Meta httpEquiv 属性

ການອະທິບາຍແລະກົນການນໍາໃຊ້

httpEquiv ການກະກຽມຫຼືການບັນທຶກ HTTP ຫົວຂໍ້ຂອງຂໍ້ມູນ <meta> content.

<meta> http-equiv 属性 Can be used to simulate HTTP response headers.

value of the http-equiv attribute depends on the value of the content attribute.

ຄວາມເຫັນ:If the name attributeIf the attribute is not set, then the http-equiv attribute should not be set.

Please see also:

ຊື່ລະບຸ HTMLອອກສຽງ <meta> HTML

Example

Example 1

Return the HTTP header information in the content property:

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

Try it yourself

Example 2

Change the values of the http-equiv and content properties. The following example will refresh the document every 30 seconds:

document.getElementsByTagName("META")[0].httpEquiv = "refresh";
document.getElementsByTagName("META")[0].content = "30";

Try it yourself

Syntax

Return the httpEquiv property:

metaObject.httpEquiv

Set the httpEquiv property:

metaObject.httpEquiv = HTTP-header
Some commonly used HTTP-header values are:

ຄູ່ມືທີ່ມີຄວາມສຳຄັນ:

ຄູ່ມື: ສະແດງ:
content-type

ກຳນົດຄູ່ມືວິທະຍາສານຂອງເນື້ອທີ່ຂອງເອກະສານ.

ຄວາມເຫັນ:ຄວາມເຫັນ: ຕ້ອງກຳນົດຄູ່ມືວິທະຍາສານພາສາ.

ຕົວຢ່າງ:

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

default-style

ກຳນົດການນໍາໃຊ້ກົດແບບສະເພາະ.

ຕົວຢ່າງ:

<meta http-equiv="default-style" content="the documents preferred stylesheet">

ຄວາມເຫັນ:ຄູ່ມືທີ່ມີຄວາມສຳຄັນຂອງຂໍ້ຂັດຂອງປະຕິກິລິຍາ content ຕ້ອງມີຄວາມສຳຄັນທີ່ຄືກັບທີ່ມີຢູ່ໃນປະຕິກິລິຍາ link ຂອງພາສາບັນຊີດັ່ງກ່າວ ຫລືມັນຕ້ອງມີຄວາມສຳຄັນທີ່ຄືກັບທີ່ມີຢູ່ໃນປະຕິກິລິຍາ style ຂອງພາສາບັນຊີດັ່ງກ່າວ.

refresh

ກຳນົດຄັ້ງທີ່ເວລາສະຫລອດຂອງການຂັບຂວາງເບື້ອງໝູ່ບັນຊີ.

ຕົວຢ່າງ:

<meta http-equiv="refresh" content="300">

ຄວາມເຫັນ:ຕ້ອງມີຄວາມລະມັດລະວັງພາສາ "refresh" ຍ້ອນວ່າມັນຈະເປັນການຍົກຍ້າຍອຳນາດຂອງເບື້ອງໝູ່ບານບັນຊີຂອງເຂົາ. ການໃຊ້ "refresh" ຈະເຮັດໃຫ້ຄູ່ມືຂອງ W3C Web Content Accessibility Guidelines ບໍ່ປະສົບຜົນ.

ລາຍລະອຽດດ້ານເຕັກນິກ

ຜົນການບັນທຶກ ຄວາມຄິດ, ຂໍ້ມູນກ່ຽວກັບຂໍ້ມູນຫົວຂໍ້ HTTP ຄຳຕອບ

ການສະໜັບສະໜູນບັນດາບຸລິມະສິດ

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
ການສະໜັບສະໜູນ ການສະໜັບສະໜູນ ການສະໜັບສະໜູນ ການສະໜັບສະໜູນ ການສະໜັບສະໜູນ

ຫົວຂໍ້ກ່ຽວກັບ

ຊື່ລະບຸ HTMLລັກສະນະ <meta> http-equiv HTML