Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Ramon Melo

[Resolvido] Abre Firefox e nao abre IE

Recommended Posts

Galera me ajuda por favor.. to finaliznado um site, agora testando, funciona perfeitamente no firefox, mas no IE nao funciona direito.. por exemplo, tenho o menu estilo sanfona (que está em javascript + ajax como voces podem ver). No Internet explorer o site abre normal, ai eu clico no primeiro botão do menu e ele funciona perfeitamente. A partir do segundo click que eu vou da, em alguma outra opção do menu, nada acontece, ao invés de abrir a pagina na div, ele aparece apenas uma imagem (essa imagem nunca existiu no meu codigo chamada loader.gif, sendo que a imagem nem aparece,fica com aquele quadrado branco com um [X] no meio), vou mandar o codigo agora da index.php..

index.php

<!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=iso-8859-1" />
<title>Larp - Laboratório de Apoio Roberto Picanço</title>
  <script type="text/javascript" src="sistemalab/jquery.js"></script>
	<script>
	$(document).ready(function(){
		$("dd:not(:first)").hide();
		$("dt a").click(function(){
			$("dd:visible").slideUp("slow");
			$(this).parent().next().slideDown("slow");
			return false;
		});
	});
	</script>
<script language="javascript" src="ajax.js"></script>
<script language="javascript" src="instrucao.js"></script>
	<style>
	body { font-family: Tahoma; font-size: 13px; }
	dl { width: 190px; }
	dl,dd { margin: 0; }
	dt { background: #006400; font-size: 15px; padding: 5px; margin: 2px; border:2 }
	dt a { color: #FFF; }
	dd a { color: #000; }
	ul { list-style: none; padding: 5px; }
	</style>
	<style>
	p {font-family:Tahoma, Geneva, sans-serif; font-size: 13px; text-align:justify; color:#003300}
	</style>
<style type="text/css"> 
<!-- 
body  {
	font: 100% Verdana, Arial, Helvetica, sans-serif;
	background: #666666;
	margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
	padding: 0;
	text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
	color: #000000;
	background-color: #030;
	margin-left: 0px;
	margin-top: 0px;
}

/* Tips for Elastic layouts 
1. Since the elastic layouts overall sizing is based on the user's default fonts size, they are more unpredictable. Used correctly, they are also more accessible for those that need larger fonts size since the line length remains proportionate.
2. Sizing of divs in this layout are based on the 100% font size in the body element. If you decrease the text size overall by using a font-size: 80% on the body element or the #container, remember that the entire layout will downsize proportionately. You may want to increase the widths of the various divs to compensate for this.
3. If font sizing is changed in differing amounts on each div instead of on the overall design (ie: #sidebar1 is given a 70% font size and #mainContent is given an 85% font size), this will proportionately change each of the divs overall size. You may want to adjust based on your final font sizing.
*/
.twoColElsLtHdr #container { 
	width: 48em;  /* this width will create a container that will fit in an 800px browser window if text is left at browser default font sizes */
	background: #D3FFD2;
	margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
	border: 1px solid #000000;
	text-align: left; /* this overrides the text-align: center on the body element. */
} 
.twoColElsLtHdr #header { 
	background: #D3FFD2; 
	padding: 0 10px;  /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
} 
.twoColElsLtHdr #header h1 {
	margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
	padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
}

/* Tips for sidebar1:
1. Be aware that if you set a font-size value on this div, the overall width of the div will be adjusted accordingly.
2. Since we are working in ems, it's best not to use padding on the sidebar itself. It will be added to the width for standards compliant browsers creating an unknown actual width. 
3. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".twoColElsLtHdr #sidebar1 p" rule.
*/
.twoColElsLtHdr #sidebar1 {
	float: left; 
	width: 13em; /* since this element is floated, a width must be given */
	background: #D3FFD2; /* the background color will be displayed for the length of the content in the column, but no further */
	padding: 15px 0; /* top and bottom padding create visual space within this div */
	margin-left: 10px;
	text-align:justify;
}
.twoColElsLtHdr #sidebar1 h3, .twoColElsLtHdr #sidebar1 p {
	margin-left: 10px; /* the left and right margin should be given to every element that will be placed in the side columns */
	margin-right: 5px;
}

/* Tips for mainContent:
1. If you give this #mainContent div a font-size value different than the #sidebar1 div, the margins of the #mainContent div will be based on its font-size and the width of the #sidebar1 div will be based on its font-size. You may wish to adjust the values of these divs.
2. The space between the mainContent and sidebar1 is created with the left margin on the mainContent div.  No matter how much content the sidebar1 div contains, the column space will remain. You can remove this left margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends.
3. To avoid float drop, you may need to test to determine the approximate maximum image/element size since this layout is based on the user's font sizing combined with the values you set. However, if the user has their browser font size set lower than normal, less space will be available in the #mainContent div than you may see on testing.
4. In the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs that may occur.
*/
.twoColElsLtHdr #conteudo_mostrar {
	margin: 0 1.5em 0 15em; /* the right margin can be given in ems or pixels. It creates the space down the right side of the page. */
} 
.twoColElsLtHdr #footer { 
	padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
	background:#D3FFD2;
} 
.twoColElsLtHdr #footer p {
	margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
	padding: 5px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
}

/* Miscellaneous classes for reuse */
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
	float: right;
	margin-left: 8x;
}
.fltlft { /* this class can be used to float an element left in your page */
	float: left;
	margin-right: 8px;
}
.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
	clear:both;
	height:0;
	font-size: 1px;
	line-height: 0px;
}
--> 
</style><!--[if IE]>
<style type="text/css"> 
/* place css fixes for all versions of IE in this conditional comment */
.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->
</head>

<body class="twoColElsLtHdr">

<div id="container">
  <div id="header">
	<h1><img src="images/banner.gif" width="700" height="85" alt="banner" /></h1>
  <!-- end #header --><hr /></div>
  <div id="sidebar1">
	<body>
<dl>
	<dt><a href="#" onClick="abrirPag('principal.html');">Home</a></dt>
	<dt><a href="/">Institucional</a></dt>
	<dd>
	<ul>
		<li><a href="#" onClick="abrirPag('biografia.html');">Biografia</a></li>
		<li><a href="#" onClick="abrirPag('missao.html');">Missão</a></li>
		<li><a href="#" onClick="abrirPag('direcao.html');">Direção</a></li>
		<li><a href="#" onclick="abrirPag('valores.html');">Valores</a></li>
	</ul>
	</dd>
	<dt><a href="/">Resultados</a></dt>
	<dd>
	<ul>
		<li><a href="#" onClick="abrirPag('resultados.html');">Pacientes</a></li>

	</ul>
	</dd>
	<dt><a href="/">Contato</a></dt>
	<dd>
	<ul>
		<li><a href="#" onclick="abrirPag('atendimento.html');">Atendimento</a></li>
		<li><a href="#" onclick="abrirPag('form_contato.php');">Fale Conosco</a></li>
	</ul>
	</dd></dl>
<br /><b><hr /><font color="#003300" size="+1"><center>Notícias</center></font></b>
<font face="Tahoma, Geneva, sans-serif" size="-2" style="text-align:justify" size="-2">
<?php include "noticias/noticias.php";  ?>
</font>
</dl>
  <!-- end #sidebar1 --></div>
  <div id="conteudo_mostrar">
<p><font size="+1"><b>Laboratório de Apoio Roberto Picanço</b></font></p>
<p><font size="-1"><em><strong>Excelência em qualidade.
  
</strong></em></font></p>
<p><font size="-1">O plano inicial do programa de qualidade é garantir a correta identificação, o acondicionamento, e o transporte dos materiais biológicos. Profissionais de elevada capacidade técnica e científica e o uso de equipamentos automáticos gerenciados através de software capaz de monitorar todo processo de realização dos exames, asseguram a rápida liberação de resultados precisos e confiáveis. </font></p>
</div>
	<!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
   <div id="footer">
   <hr />
	<p><center><font size="-2"> Copyright 2009 - Laboratorio de Apoio Roberto Picanço - Todos os direitos reservados.<br />
	<strong><br />
	Fone: - Email: <a href="mailto:larp@larp.com.br">larp@larp.com.br </a></strong></font>
	</center></p>
  <!-- end #footer --></div>
<!-- end #container --></div>
</body>
</html>

Desculpem o tamanho do codigo, to louco querendo saber o q acontece.. muito obrigado galera, valeu!!

Compartilhar este post


Link para o post
Compartilhar em outros sites

SEGUE OS ARQUIVOS:

INSTRUCAO.JS

function abrirPag(valor){
	var url = valor;

	xmlRequest.onreadystatechange = mudancaEstado;
	xmlRequest.open("GET",url,true);
	xmlRequest.send(null);

		if (xmlRequest.readyState == 1) {
			document.getElementById("conteudo_mostrar").innerHTML = "<img src='loader.gif'>";
		}

	return url;
}

function mudancaEstado(){
	if (xmlRequest.readyState == 4){
		document.getElementById("conteudo_mostrar").innerHTML = xmlRequest.responseText;
	}
}

ajax.js

function GetXMLHttp() {
	var xmlHttp;
	try {
		xmlHttp = new XMLHttpRequest();
	}
	catch(ee) {
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e) {
			try {
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e) {
				xmlHttp = false;
			}
		}
	}
	return xmlHttp;
}

var xmlRequest = GetXMLHttp();

Oq pode ser gente? :||| valeu ae

Compartilhar este post


Link para o post
Compartilhar em outros sites

nao tenho aonde hospedar cara.. mas ja testei em algumas outras maquinas tambem e nao funcionam..

somente no IE...

testei opera, firefox, tudo normal..

Ie6 e 7 nao funcionam! :/

 

valeu

Compartilhar este post


Link para o post
Compartilhar em outros sites

Resolvi galera..

usando esse script agora;

 

<head>
<script type="text/javascript">
var xmlhttp = getXmlHttpRequest();
  
function getXmlHttpRequest()
{
   if (window.XMLHttpRequest)
   {
	  return new XMLHttpRequest();
   }
   else if (window.ActiveXObject)
   {
	  try
	  {
		 return new ActiveXObject("Msxml2.XMLHTTP");
	  }
	  catch (e)
	  {
		 try
		 {
			return new ActiveXObject("Microsoft.XMLHTTP");
		 }
		 catch (e){}
	  }
   }
}

function requisicao(_strNomePagina)
{
	  xmlhttp.open("GET", _strNomePagina, true);
	  xmlhttp.setRequestHeader("Content-Type", "text/html; charset=iso-8859-1");
	  xmlhttp.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
	  xmlhttp.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
	  xmlhttp.setRequestHeader("Pragma", "no-cache");
	  xmlhttp.onreadystatechange = function()
	  {
		 if (xmlhttp.readyState==4)
		 {
			document.getElementById('conteudo').innerHTML = xmlhttp.responseText;
		 }
	  }  
	  xmlhttp.send(null);
}
</script>
</head>
<body>

<a href="java script: requisicao('arquivo.html');">:: Pagina</a>
<a href="java script: requisicao('arquivo2.html');">:: Pagina</a>

<div id="conteudo">
ABRIR AQUI

</div>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.