2012-10-02 17 views
13

Ho un problema quando passo il validatore html5 al mio sito da w3c validator. Gli errori sono i seguenti:Valori errati nei meta tag

Bad value Content-Script-Type for attribute http-equiv on element meta 
<meta http-equiv="Content-Script-Type" content="text/javascript" > 

Bad value expires for attribute http-equiv on element meta 
<meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT" > 

Bad value pragma for attribute http-equiv on element meta 
<meta http-equiv="pragma" content="no-cache" > 

Bad value Cache-Control for attribute http-equiv on element meta. 
<meta http-equiv="Cache-Control" content="no-cache" > 

Quali sono i valori corretti per i metatag per passare il validatore html5?

+1

possibile duplicato del [HTML5 meta di convalida] (http://stackoverflow.com/questions/9655526/html5-meta-validation) – Barett

risposta

8

Per HTML5 si utilizza un file manifest di cache nell'intestazione. Questo è un esempio di come utilizzare: http://www.w3.org/TR/html5/browsers.html#manifests

Inoltre, si forza la cache non con questo:

<meta http-equiv="expires" content="0"> 

Questo è un buon tutorial su come utilizzare il file manifesto di cache: http://www.html5rocks.com/en/tutorials/appcache/beginner/

+1

Grazie per il vostro aiuto. Ma ho ancora lo stesso problema con il seguente meta tag: '' con il messaggio error: ** Bad value Content-Script- Digitare per l'attributo http-equiv sull'elemento meta ** Conosci qualche soluzione? Grazie in anticipo –

+1

@ JoséCarlos - Per javascript nell'intestazione, puoi semplicemente usare ''. Per ulteriori informazioni, consultare questo link: http://stackoverflow.com/questions/6320084/why-is-meta-http-equiv-content-script-type-mostly-unused – ews2001

+5

expires meta non è consentito in html5 – Barett

5

La risposta accettata è errata! This è una buona risposta.

Per citare Alohci:

Putting caching instructions into meta tags is not a good idea, because although browsers may read them, proxies won't. For that reason, they are invalid and you should send caching instructions as real HTTP headers.