Movatterモバイル変換


[0]ホーム

URL:


  1. Glossary
  2. Quality values

Quality values

Quality values, orq-values andq-factors, are used to describe the order of priority of values in a comma-separated list. It is a special syntax allowed in someHTTP headers and in HTML.

The importance of a value is marked by the suffix';q=' immediately followed by a value between0 and1 included, with up to three decimal digits, the highest value denoting the highest priority. When not present, the default value is1.

Examples

The following syntax

http
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

indicates the order of priority:

ValuePriority
text/html andapplication/xhtml+xml1.0
application/xml0.9
*/*0.8

If there is no priority defined for the first two values, the order in the list is irrelevant. Nevertheless, with the same quality, more specific values have priority over less specific ones:

http
text/html;q=0.8,text/*;q=0.8,*/*;q=0.8
ValuePriority
text/html0.8 (but totally specified)
text/*0.8 (partially specified)
*/*0.8 (not specified)

Some syntax, like the one ofAccept, allow additional specifiers liketext/html;level=1. These increase the specificity of the value. Their use is extremely rare.

More information

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp