Komut dosyası türü Özellik
Örnek
Bir komut dosyasının MIME türünü alın:
var x = document.getElementById("myScript").type
Tanım ve Kullanım
type özelliği, bir komut dosyasının type özniteliğinin değerini ayarlar veya döndürür.
type özelliği, bir komut dosyasının MIME türünü belirtir.
type özelliği, <script> ve </script> etiketleri arasındaki içeriği tanımlar.
MIME türü iki bölümden oluşur: bir ortam türü ve bir alt tür. JavaScript için MIME türü "metin/javascript"tir.
Not: HTML5'te type niteliği artık gerekli değildir. Varsayılan değer "metin/javascript"tir.
Tarayıcı Desteği
Property | |||||
---|---|---|---|---|---|
type | Yes | Yes | Yes | Yes | Yes |
Sözdizimi
type özelliğini döndürün:
scriptObject.type
type özelliğini ayarlayın:
scriptObject.type = MIME_type
Mülk değerleri
Value | Description |
---|---|
MIME_type | Specifies the MIME type of the script. Some common values:
Look at IANA MIME types for a complete list of standard MIME types. |
Teknik detaylar
Geri dönüş değeri: | Komut dosyasının MIME türünü temsil eden bir Dize |
---|
İlgili Sayfalar
HTML referansı: HTML <script> tipi özniteliği
❮ Komut Dosyası Nesnesi