Ver Mensaje Individual
  #5 (permalink)  
Antiguo 05/03/2010, 15:03
akinilator
 
Fecha de Ingreso: marzo-2010
Mensajes: 9
Antigüedad: 14 años, 2 meses
Puntos: 0
Respuesta: Problema objeto Location

ok, al final mi codigo quedaria asi:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Hello!</title>

<script languaje="javascript">
function ejercicio(){
document.write('hash: ')
document.write(location.hash)
document.write('<br />')
document.write('host: ')
document.write(location.host)
document.write('<br />')
document.write('hostname: ')
document.write(location.hostname)
document.write('<br />')
document.write('href: ')
document.write(location.href)
document.write('<br />')
document.write('port: ')
document.write(location.port)
document.write('<br />')
document.write('protocol: ')
document.write(location.protocol)
document.write('<br />')
document.write('pathname: ')
document.write(location.pathname)
document.write('<br />')
}
</script>

</head>

<body>
<script languaje="javascript">
document.write(ejercicio());
</script>
<br>
<input type="submit" value="Actualizar" onClick="javascript:location.reload()">

</body>

</html>

Pero ahora el problema es el siguiente:

hash:
host:
hostname:
href: file:///C:/Users/Fran/Desktop/prev3~.html
port:
protocol: file:
pathname: /C:/Users/Fran/Desktop/prev3~.html
undefined

que no me muestra nada en los campos que estan vacios, cuando antes si me lo mostraba.