Hi all!
I'm making a site with a div for advertising that swaps the ads (every 3 seconds) based on the name saved in the database.
It's working perfectly in FF and Chrome, but it does not work in the IE.
I have a file called comercial.php tha I include on page deficienciaIntelectual.php, where the ads appears. On that page also have a small script to change the images every 3 seconds. here are the codes.
Comercial.php:
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
include 'conexao.php';
$registros = array(0);
$qtdRegistros = 0;
function comercialRandon() {
$selectComercial = mysql_query("select nome from comercial order by rand() limit 1;");
global $registros;
$registros = mysql_fetch_array($selectComercial);
return $registros[0];
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Atualiza div</title>
</head>
<body >
<?
$registros = array();
comercialRandon();
echo ' <img alt="publicidade" src="imagens/db/comercial/' . $registros[0] . '.jpg"></>';
?>
</body>
</html>
deficienciaIntelectual.php:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Campanha de Arrecadação de Fundos APAE</title>
<link rel="stylesheet" type="text/css" href="index.css"/>
</head>
<body onLoad="modoEspera()">
<div id="painelDireita">
<p>
<img src="imagens/menininha.jpg" alt="menininha"></>
</p>
<div id="caixaTextoFlutuante">
<ul>
<li><a href="?pag=deficienciaIntelectual&contTexto=oQueE">O que é</a></li>
<li><a href="?pag=deficienciaIntelectual&contTexto=comoPrevinir">Como Previnir</a></li>
<li><a href="?pag=deficienciaIntelectual&contTexto=comoDiagnosticar">Como Diagnosticar</a></li>
<li><a href="?pag=deficienciaIntelectual&contTexto=comoTratar">Como Tratar</a></li>
<li><a href="?pag=deficienciaIntelectual&contTexto=direitoEBeneficios">Direitos e Benefícios</a></li>
</ul>
</div>
<div id="caixaTexto">
<? include 'paginaCaixaTexto.php'; ?>
</div>
</div>
<div id="painelEsquerda">
<div id="painelMenu">
<p id="caminhoSiteLaranja">
home > Deficiencia Intelectual
</p>
<p class="menuEsquerda laranja">Descrição</p>
<p class="menuEsquerda laranja">Descrição</p>
<p class="menuEsquerda laranja">Descrição</p>
<p class="menuEsquerda laranja">Descrição</p>
<p class="menuEsquerda laranja">Descrição</p>
</div>
<script type="text/javascript" >
function modoespera() {
setInterval("atualiza()",3000);
}
function atualiza() {
$("#comercial1").load("pages/comercial.php");
$("#comercial2").load("pages/comercial.php");
}
</script>
<div id="painelPropaganda">
<div id="comercial1" class="publicidade">
<? include 'pages/comercial.php'; ?>
</div>
<div id="comercial2" class="publicidade">
<? include 'pages/comercial.php'; ?>
</div>
</div>
</div>
</body>
</html>
Compatibility problem
Moderator: General Moderators
Re: Compatibility problem
Please, somebody help me!
Re: Compatibility problem
It would seem to me that if you have this working in FF and Chrome, then your problem will most likely be in the way in which IE is handling that script. Your main problem here is that your having to work with IE, any version of IE at that.
Which version of IE do you have? Because i am fairly sure that IE8 and IE9 have developer tools installed which can help you debug those JavaScript errors.
I know that in IE9, you can press F12 to bring that up. From there you have to check the "Console" section of the tool.
Just keep in mind though that even if you solve a JavaScript problem in say IE9, your not guaranteed to fix that in IE6,7,8
Which version of IE do you have? Because i am fairly sure that IE8 and IE9 have developer tools installed which can help you debug those JavaScript errors.
I know that in IE9, you can press F12 to bring that up. From there you have to check the "Console" section of the tool.
Just keep in mind though that even if you solve a JavaScript problem in say IE9, your not guaranteed to fix that in IE6,7,8
-
x_mutatis_mutandis_x
- Forum Contributor
- Posts: 160
- Joined: Tue Apr 17, 2012 12:57 pm
Re: Compatibility problem
I agree, IE9 is very different from the older versions (besides working only with Win7 OS).Weiry wrote:Just keep in mind though that even if you solve a JavaScript problem in say IE9, your not guaranteed to fix that in IE6,7,8
Re: Compatibility problem
Thanks for answering!
i already was using the f12 trying to find a mistake in the code, but i didn't find anything, but thanks for suggesting.
the problem was the IE was keeping the comercial.php page in cache, i turned off the cache and saw everything working fine, but for the user don't need to do this configuration, as is need in so many sites, i looked for a code to do this automatically. This is the code i used:
<?php
// Data in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always changed
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
?>
thanks again!
i already was using the f12 trying to find a mistake in the code, but i didn't find anything, but thanks for suggesting.
the problem was the IE was keeping the comercial.php page in cache, i turned off the cache and saw everything working fine, but for the user don't need to do this configuration, as is need in so many sites, i looked for a code to do this automatically. This is the code i used:
<?php
// Data in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always changed
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
?>
thanks again!
-
x_mutatis_mutandis_x
- Forum Contributor
- Posts: 160
- Joined: Tue Apr 17, 2012 12:57 pm
Re: Compatibility problem
Thats right, you can control the cache using the headers (as you have them listed above, which will never cache the page).reinildes wrote:thanks for answering!
i already was using the f12 trying to find a mistake in the code, but i didn't fink anything, but thanks for suggesting.
the problem was the IE was keeping the comercial.php page in cache, i turn off the cache and see everything working, but for the user don'n need to do this configuration, as is need in so many sites, i look for a code to do this automaticly. This is the code i used:
<?php
// Data no passado
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// Sempre modificado
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
?>
thanks again!