No consigo pasar el validador, me dice que noscript no es una etiqueta
vÃlida. (http://www.txurdi.net/pruebas/jscsiono/prueba1.php)
Como se hace para dar una opciÃn diferente a los usuarios que no tienen
javascript?
os paso mi cÃdigo (es PHP), y debajo pongo el cÃdigo generado y los errores:
----------------------------------------------------------------------------------------------------
CÃDIGO PHP:
----------------------------------------------------------------------------------------------------
<?php

if ( (!isset($_GET['width'])) AND
    (!isset($_GET['height'])) AND
 (!isset($_GET['javascript'])))
{
?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="es" lang="es">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="content-language" content="es" />
<meta name="keywords" content="txurdi" />
<meta name="description" content="PÃgina personal de txurdi." />
<meta name="generator" content="Dev-PHP 3.00 Alpha 4" />
<meta http-equiv="Pragma" content="no-cache" />
<title>Pagina personal de txurdi</title>

<?php
 echo "<script type=\"text/javascript\">\n";
 echo "
location.href=\"${_SERVER['SCRIPT_NAME']}?${_SERVER['QUERY_STRING']}"
         . "&amp;width=\" + screen.width + \"&amp;height=\" +
screen.height;\n";
 echo "</script>\n";
 echo "<noscript>\n";
 echo "<meta http-equiv= \"refresh\" content=\"0;
url=http://www.txurdi.net${_SERVER['SCRIPT_NAME']}?${_SERVER['QUERY_STRING']}&amp;javascript=desactivado\"
/>\n";
 echo "</noscript>\n";
?>

</head>

<body>
<p>No tienes javascript.</p>
</body>
</html>
<?php
 exit();
}
else
{
?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="es" lang="es">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="content-language" content="es" />
<meta name="keywords" content="txurdi" />
<meta name="description" content="PÃgina personal de txurdi." />
<meta name="generator" content="Dev-PHP 3.00 Alpha 4" />
<meta http-equiv="Pragma" content="no-cache" />
<title>Pagina personal de txurdi</title>
</head>

<body>
<p>Tienes javascript, o no.</p>
<?php echo "!{$_GET['width']}! !{$_GET['height']}! !{$_GET['javascript']}!";
?>
</body>
</html>

<?php
}
?>
----------------------------------------------------------------------------------------------------
CÃDIGO GENERA ESTA PÃGINA PARA EL VALIDADOR:
----------------------------------------------------------------------------------------------------
1: <!DOCTYPE html
2:      PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3:      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
4: <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="es" lang="es">
5: <head>
6: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
7: <meta http-equiv="content-language" content="es" />
8: <meta name="keywords" content="txurdi" />
9: <meta name="description" content="PÃgina personal de txurdi." />
10: <meta name="generator" content="Dev-PHP 3.00 Alpha 4" />
11: <meta http-equiv="Pragma" content="no-cache" />
12: <title>Pagina personal de txurdi</title>
13:
14: <script type="text/javascript">
15:   location.href="/pruebas/jscsiono/prueba1.php?&amp;width=" +
screen.width + "&amp;height=" + screen.height;
16: </script>
17: <noscript>
18: <meta http-equiv= "refresh" content="0;
url=http://www.txurdi.net/pruebas/jscsiono/prueba1.php?&amp;javascript=desactivado";
/>
19: </noscript>
20:
21: </head>
22:
23: <body>
24: <p>No tienes javascript.</p>
25: </body>
26: </html>
----------------------------------------------------------------------------------------------------
ERRORES:
----------------------------------------------------------------------------------------------------
 1.. Line 17, column 9: document type does not allow element "noscript"
here; assuming missing "object" start-tag

 <noscript>

 â

 2.. Line 18, column 125: document type does not allow element "meta" here

 ...a1.php?&amp;javascript=desactivado" />

 The element named above was found in a context where it is not allowed.
This could mean that you have incorrectly nested elements -- such as a
"style" element in the "body" section instead of inside "head" -- or two
elements that overlap (which is not allowed).

 One common cause for this error is the use of XHTML syntax in HTML
documents. Due to HTML's rules of implicitly closed elements, this error can
create cascading effects. For instance, using XHTML's "self-closing" tags
for "meta" and "link" in the "head" section of a HTML document may cause the
parser to infer the end of the "head" section and the beginning of the
"body" section (where "link" and "meta" are not allowed; hence the reported
error).

 â

 3.. Line 21, column 6: end tag for "object" omitted, but OMITTAG NO was
specified

 </head>

 You may have neglected to close a tag, or perhaps you meant to
"self-close" a tag; that is, ending it with "/>" instead of ">".

 â

 4.. Line 17, column 0: start tag was here

 <noscript>

----- Original Message ----- From: "Eva del Campo" <[EMAIL PROTECTED]>
To: "Ovillo, la lista de CSS en castellano" <ovillo@lists.ovillo.org>
Sent: Wednesday, April 20, 2005 1:52 PM
Subject: Re: [Ovillo] Como saber resolucion de pantalla



Lo primero que se me ocurre, es que utilices la etiqueta noscript y redirecciones desde ahà con un header. SerÃa algo asÃ:

echo "<script language=\"javascript\">\n";
Aquà tu cÃdigo anterior
echo "</script>\n";
echo "<noscript>\n";
echo "<meta http-equiv= \"refresh\" content=
\"0;url=http://www.tuweb.com?javascript=desactivado\";>\n";
echo "</noscript>\n";

La condiciÃn deberÃas cambiarla por if (!isset($_GET['width']) and
!isset($_GET['height']) and $_GET[' javascript'] != 'desactivado')

Comprueba la sintaxis, lo he escrito de memoria.

xxxx

Eva

Hola lista,
tengo una web (www.txurdi.net) en la que lo primero de todo pongo un
javascript que calcula la resolucion de pantalla, y luego redirecciona a
la
misma direccion pasando como GET los valores ancho y alto.
uso PHP.
Claro que, esto no es accesible, y quiero arreglarlo, porque si no, la
gente
que no tiene javascript, no lo ve...
Los valores esos los uso para llevar una gestion de que resoluciones usan
mis usuarios.
Hay alguna otra manera de conseguir esos valores sin usar javascript? o de
hacer que si no tiene javascript siga adelante?

os paso mi cÃdigo PHP para que lo veais:

<?php

if (!isset($_GET['width']) AND !isset($_GET['height']))
{
  echo "<script language=\"javascript\">\n";
  echo "
location.href=\"${_SERVER['SCRIPT_NAME']}?${_SERVER['QUERY_STRING']}"
          . "&width=\" + screen.width + \"&height=\" + screen.height;\n";
  echo "</script>\n";
  exit();
}
else
{
...la pÃgina normal
}


un saludo, txurdi



_______________________________________________
Lista de distribución Ovillo
Para escribir a la lista, envia un correo a Ovillo@lists.ovillo.org
Puedes modificar tus datos o desuscribirte en la siguiente dirección: 
http://ovillo.org/mailman/listinfo/ovillo

Responder a