Ver Mensaje Individual
  #7 (permalink)  
Antiguo 08/04/2013, 01:19
dBer
 
Fecha de Ingreso: febrero-2012
Mensajes: 59
Antigüedad: 12 años, 3 meses
Puntos: 0
Respuesta: Recargar web si hash vacío

Cita:
Iniciado por emprear Ver Mensaje
Si, ya lo noté, al abrir por primera vez no funciona bien en FF, hacelo asi
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>titulo</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <script type="text/javascript">
  7. //<![CDATA[
  8. window.onload= function(){
  9. if(!location.hash){
  10. window.location.href = "#marcador";
  11. }
  12. }
  13. //]]>
  14. </head>
  15. <div style="height: 900px;">contenido A</div>
  16. <div id="marcador" style="background: red;">marcador</div>
  17. </body>
  18. </html>
Así te asegurás que el objeto window carga completamente
A mi me funcionó bien
Saludos
Ahora si! Muchas gracias por tu ayuda de verdad!! Que grande!

Saludos!

Última edición por dBer; 12/04/2013 a las 02:52