Foros del Web » Programando para Internet » Jquery »

[SOLUCIONADO] Error visualizar en servidor

Estas en el tema de Error visualizar en servidor en el foro de Jquery en Foros del Web. Hola! He estado trabajando un html el cual se alimenta de un XML mediante Jquery, todo va bien de modo local, pero cuando lo subo ...
  #1 (permalink)  
Antiguo 18/02/2013, 17:25
 
Fecha de Ingreso: febrero-2013
Ubicación: México
Mensajes: 2
Antigüedad: 11 años, 2 meses
Puntos: 0
Exclamación Error visualizar en servidor

Hola!
He estado trabajando un html el cual se alimenta de un XML mediante Jquery, todo va bien de modo local, pero cuando lo subo a algun servidor no me muestra nada.

Lo he probado en 2 servidores IIS y en un apache y en ninguno de los 3 me da resultado.

a continuación les escribo el código que estoy usando.


HTML - JS
Código:
<!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">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Operaciones</title>



<script src="js/jquery.min.js" type="text/javascript"></script>
<link href="css/estilos.css" rel="stylesheet" type="text/css" />



 
</head>
<body>  
   
                
                
                
      <table border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td> 
           <div id="contenido"> 
<div id="texto1"></div>
<div id="resaltar"></div>
<div class="texto2"></div> 
              <div  ></div>
<div id="texto3"></div> 
              <p><div id="texto4"></div></p>
              <br />
              <br />
              <div id="cursivas" class="cursivass"></div> </div>
                        
          </td>
        </tr>
      </table>
     
    </td>
		</tr>
	</table>
    

 <script>
$(document).ready(function() {
 	
	 $.get('xml/operaciones_contenido.xml', function(data) {
	var xmlDoc = $.parseXML( data ),    
	$xml = $( xmlDoc ),    
	
	$title = $xml.find( "texto1" );
	$("#texto1").append($title.text());
	
	$title = $xml.find( "resaltar" );
	$("#resaltar").append($title.text());
	
	$title = $xml.find( "texto2" );
	$("#texto2").append($title.text());
	
	$title = $xml.find( "subrayado" );
	$("#subrayado").append($title.text());	
	
	$title = $xml.find( "texto3" );
	$("#texto3").append($title.text());

	$title = $xml.find( "texto4" );
	$("#texto4").append($title.text());
	
	$title = $xml.find( "cursivas" );
	$("#cursivas").append($title.text());

	
	});
	 
	 
	
	 });

 
 </script>
              
                    
                    
</body>
</html>



y aquí el XML:

Código:
<contenido>
	<texto1>
	Nuestra Unidad de Negocios 
	</texto1>
	<resaltar>
	“SIS DIM Operaciones”
	</resaltar>
	<texto2>
	está conformada por  
	</texto2>
	<subrayado>
	un solo equipo de trabajo 
	</subrayado>
	<texto3>
	que se encargará de la ejecución y entrega de proyectos de Information Management.  
	</texto3>
	<texto4>
	Esta Unidad de Negocios agrupará tres elementos clave: 
	</texto4>
	<cursivas>
	Para conocer la función y responsabilidades de cada elemento, da clic en el círculo:
	</cursivas>
</contenido>

de antemano les agradezco su tiempo y ayuda.

Última edición por aikonmx; 18/02/2013 a las 17:31
  #2 (permalink)  
Antiguo 19/02/2013, 17:03
 
Fecha de Ingreso: febrero-2013
Ubicación: México
Mensajes: 2
Antigüedad: 11 años, 2 meses
Puntos: 0
Respuesta: Error visualizar en servidor

Pues al parecer era cuestion de seguridad.

Cambié el código al siguiente y ya va bien.

Gracias!...



Código:
// JavaScript Document

$(document).ready(function() {

    $.ajax({type: "GET",
        url: "books.xml",
        dataType: "xml",
        cache: false,
        success: function(xml){ 

  
  $(xml).find('name').each(function() { 
    $("#name").append($(this).text());
        });
		
		
		 $(xml).find('cursivas').each(function() { 
    $("#cursivas").append($(this).text());
        });

		 $(xml).find('texto1').each(function() { 
    $("#texto1").append($(this).text());
        });

		 $(xml).find('resaltar').each(function() { 
    $("#resaltar").append($(this).text());
        });

		 $(xml).find('texto2').each(function() { 
    $("#texto2").append($(this).text());
        });


		 $(xml).find('subrayado').each(function() { 
    $("#subrayado").append($(this).text());
        });
		
				 
		$(xml).find('texto3').each(function() { 
    $("#texto3").append($(this).text());
        });
		
		 $(xml).find('texto4').each(function() { 
    $("#texto4").append($(this).text());
        });
		
		
		
		
		
		

     }});
	 });

Etiquetas: servidor
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 15:30.