Foros del Web » Programando para Internet » Javascript » Frameworks JS »

Ayuda cargar contenido con Ajax

Estas en el tema de Ayuda cargar contenido con Ajax en el foro de Frameworks JS en Foros del Web. Hola buenas, resulta que tengo el siguiente problema.. este es el codigo Código: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>en construccion</title> ...
  #1 (permalink)  
Antiguo 23/12/2010, 12:53
 
Fecha de Ingreso: junio-2009
Mensajes: 6
Antigüedad: 14 años, 10 meses
Puntos: 0
Ayuda cargar contenido con Ajax

Hola buenas, resulta que tengo el siguiente problema.. este es el codigo


Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>en construccion</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link rel="stylesheet" type="text/css" href="slxv.css"/>
<script type="text/javascript" src="cssverticalmenu.js"></script>

	<script type="text/javascript" src="js/jquery-1.3.1.min.js"></script>
	<script type="text/javascript" src="js/jquery.easing.1.3.js"></script>
	<script>
	
	$(document).ready(function () {

		//Set the height of the block
		$('#menu .block').height($('#menu li').height());

		//go to the default selected item
		topval = $('#menu .selected').position()['top'];
		$('#menu .block').stop().animate({top: topval}, {easing: '', duration:500});

		$('#menu li').hover(
			
			function() {
				
				//get the top position
				topval = $(this).position()['top'];
				
				//animate the block
				//you can add easing to it
				$('#menu .block').stop().animate({top: topval}, {easing: '', duration:500});
				
				//add the hover effect to menu item
				$(this).addClass('hover');	
			},
			
			function() {		
				//remove the hover effect
				$(this).removeClass('hover');	
			}
		);
	
	});
	

	<script type="text/javascript" src="js/jquery-1.3.1.min.js"></script>
	<script type="text/javascript" src="js/jquery.easing.1.3.js"></script>
	
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/easySlider1.7.js"></script>

<script type="text/javascript">
	$(document).ready(function(){	
		$("#slider").easySlider({
			auto: true, 
			continuous: true
		});
	});	
</script>


<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="css/codigocss.css" rel="stylesheet" type="text/css">

<script type="text/javascript">
function ajaxFunction() {
  var xmlHttp;
  
  try {
   
    xmlHttp=new XMLHttpRequest();
    return xmlHttp;
  } catch (e) {
    
    try {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      return xmlHttp;
    } catch (e) {
      
	  try {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        return xmlHttp;
      } catch (e) {
        alert("Tu navegador no soporta AJAX!");
        return false;
      }}}
}




function Enviar(_pagina,capa) {
    var ajax;
    ajax = ajaxFunction();
    ajax.open("POST", _pagina, true);
    ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

    ajax.onreadystatechange = function() {
		if (ajax.readyState==1){
			document.getElementById(capa).innerHTML = " Aguarde por favor...";
			     }
		if (ajax.readyState == 4) {
		   
                document.getElementById(capa).innerHTML=ajax.responseText; 
		     }}
			 
	ajax.send(null);
} 



</script>
<style type="text/css">
<!--
.Estilo1 {color: #000000}
-->
</style>

<script type="text/javascript" src="js/jquery-1.3.1.min.js"></script>
	<script type="text/javascript" src="js/jquery.easing.1.3.js"></script>
	
</head>
<body>
<div id="head"> 

      <embed src="logo.swf" quality="high" wmode="transparent" width="450" height="184" swLiveConnect=true id="tormantos" align="left" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
      <embed src="rep.swf" quality="high" wmode="transparent" width="200" height="184" swLiveConnect=true id="tormantos" align="right" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></div>
<div id="menu">
  <div class="item"><a href="/contacto">CONTACTO</a></div>
        <div class="item">|</div
        ><div class="item"><a href="/fotos">EVENTOS</a></div>
        <div class="item">|</div>

        <div class="item"><a href="javascript:Enviar('movida.html','contenido')">MOVIDA</a></div>
        <div class="item">|</div>
        <div class="item"><a href="">HOME</a></div>
</div>

<div id="contenido"> 

</div>
<div id="publicidades">



</div>

<div class="Estilo1" id="pie"> <center>
  <p>2003 - 2010 San Luis X Vos<br>
      
  Todos los derechos reservados.  </p>
  </center>
</div>
</body>
</html>
Cita:
div class="item"><a href="javascript:Enviar('movida.html','contenido') ">MOVIDA</a></div>
Hasta aqui perfecto, desde el menu cargo cualquier *.html en el div llamado "contenido, pero cuando cargo "movida.html dentro tiene inscrustado una lista o menu lista, que no me deja cargar otro archivo dentro del div contenido...
Aqui les dejo el condigo de movida.html


Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>en construccion</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link rel="stylesheet" type="text/css" href="slxv.css"/>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<body>
<div id="cuerpo">
    	<table width="100%" border="0" cellpadding="5" cellspacing="5">
    <tr>

  	    <td width="225" align="center" valign="top">
    	      
                
          <p><img src="mov/img/t_1248.jpg" width="225" height="169" border="0" title="Zapping" /><br />
		    
          </p>
          <div style="width: 225px;">
        
        <select name="select5" size="1"  onchange="MM_jumpMenu('javascript:Enviar('movida/fotos.html','contenido'',this,0)">

        	<option selected="selected">Eleg&iacute; Fecha </option>
          <option value="movida/fotos.html">Viernes 10-12-10</option>


          </select>
        </form>
      </div>      </td>    
        <td width="225" align="center" valign="top">
    	      
                
        <p><img src="mov/img/t_1248.jpg" width="225" height="169" border="0" title="Wish Disco" />
          </p>
        <p>          <br />
		    
        </p>
      <div style="width: 225px;">        </div>      </td>    
        <td width="225" align="center" valign="top">
    	      
                
        <p><img src="mov/img/t_1248.jpg" width="225" height="169" border="0" title="Picasso Disco" />
          </p>
        <p>          <br />
		      
      </p>
      <div style="width: 225px;">      </div>      </td>    
      </tr>
    <tr>
  	    <td width="225" align="center" valign="top">
        <br />
		
        <div style="width: 225px;">

    
        </form>
        </div>      </td>    
        <td width="225" align="center" valign="top">&nbsp;
    	      
                
          </td>    
        <td width="225" align="center" valign="top">&nbsp;
    	        
      </td>    
      </tr>
  </table>            </div>
</div>
</body>
</html>
como puedo lograr que el archivo movida.html una vez cargando, pueda desde el menu o lista , lograr que al elegir una fecha carge en el mismo div " contenido " el archivo "/movida/fotos.html" ??

Etiquetas: ajax, html, jquery
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 20:12.