Foros del Web » Programando para Internet » Jquery »

jQuery.History problema con xhtml

Estas en el tema de jQuery.History problema con xhtml en el foro de Jquery en Foros del Web. Hola, estoy utilizando el ejemplo de : http://www.mikage.to/jquery/jquery_history.html Para adaptar una página de prueba. Despues de estar varios dias dandole vueltas me he dado cuenta ...
  #1 (permalink)  
Antiguo 18/07/2009, 11:00
 
Fecha de Ingreso: abril-2009
Mensajes: 66
Antigüedad: 15 años
Puntos: 0
Mensaje jQuery.History problema con xhtml

Hola, estoy utilizando el ejemplo de :

http://www.mikage.to/jquery/jquery_history.html

Para adaptar una página de prueba. Despues de estar varios dias dandole vueltas me he dado cuenta que el problema de navegar con los botones de Atras y hacia Adelante en Internet Explorer 8 se debía al doctype.

Si uso el doctype de HTML 4.0 (el del ejemplo de mikage.to) funciona perfectamente. Sin embargo, si pongo xhtml 1.0 (transitional) en internet explorer no va bien.

Os pongo todo el código fuente por si quereis hacer una prueba:

index.html:
Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Prueba 2</title>
	<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
	<script type="text/javascript" src="jquery.history.js"></script>
	<script type="text/javascript" src="carga.js"></script>
	<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="wrapper">
    <h1>ajax ... nettuts</h1>
    <ul id="nav">
        <li><a rel="history" href="index.html">welcome</a></li>
        <li><a rel="history" href="contenido/about.html">about</a></li>
        <li><a rel="history" href="contenido/portfolio.html">portfolio</a></li>
        <li><a rel="history" href="contenido/contact.html">contact</a></li>
        <li><a rel="history" href="contenido/terms.html">terms</a></li>
    </ul>
    <div id="cont-pcpal-cuerpo">    	
        <h2>Welcome!</h2>
        <p>Hi, welcome to the demonstration for the NETTUTS tutorial - "How to Load In and Animate Content with jQuery"</p>
        <p>In this tutorial we will be taking your average everyday website and enhancing it with jQuery. We will be adding ajax functionality so that the content loads into the relevant container instead of the user having to navigate to another page. We will also be integrating some awesome effects...</p>
    </div>
    <div id="foot">Tutorial by James for NETTUTS</div>
</div>
</body>
</html>
carga.js
Código:
function pageload(hash) {
		if(hash) {
			if($.browser.msie) {
				hash = encodeURIComponent(hash);
			}
			$("#cont-pcpal-cuerpo").load(hash+".html #content");
		} else {
			$("#cont-pcpal-cuerpo").empty();
		}
	}
	
	$(document).ready(function(){
		$.historyInit(pageload, "index.html");
		
		$("a[rel='history']").click(function(){
			var hash = $(this).attr('href');
			hash= $(this).attr('href').substr(0,$(this).attr('href').length-5);
			$.historyLoad(hash);
			return false;
		});
	});
La verdad es que desespera un poco. En otro post pregunte por si jquery.history era la mejor manera para navegar entre páginas y guardarlas en el historial, pero nadie me respondió. A ver si alguien sabría decirme a que podría deberse o como arreglar esto del doctype.

Un saludo.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 02:32.