Ir para conteúdo

POWERED BY:

Arquivado

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

porao

Problema com IE9

Recommended Posts

Ola pessoal, estou com problemas com o IE9.

O script funcioma bem para o chrome e o firefox, mas pra variar o IE tinha que dar o ar da graça.

Se alguem souber me ajudar, la vai o script:

 

no forum ha um botao em que o pessoal agradece o post.

 

echo "<script src=\"https://ajax.googleapis.com/ajax/libs/prototype/1.7.0.0/prototype.js\"></script><script type='text/javascript' src='scripts/thanks.js'></script>";
?>
<script type="text/javascript">
function thanks_ajax() {
   new Ajax.Request('thanks.php',
   {
       'method': 'post',
       parameters: { 'topico': '<?=$id?>' },
       onCreate: function() { $('thanks_response').update('processando..'); },
       onSuccess: function(t) {

           if (Prototype.Browser.IE) {
             try //Internet Explorer (stupid browser)
             {
           t.responseXML=new ActiveXObject("Microsoft.XMLDOM");
           t.responseXML.async="false";
           t.responseXML.loadXML(t.responseText);
             }
             catch(e)
             {
           $('thanks_response').update('XML error: '+e.message);
           return;
             }
           }

         objthanks = t.responseXML.firstChild.getElementsByTagName('thanks');
         objresponse = t.responseXML.firstChild.getElementsByTagName('response');
         if (objthanks.length == 0 || objresponse.length == 0)
         {
           $('thanks_response').update('XML error');
           return;
         }
         $('thanks').update(objthanks[0].firstChild.nodeValue);
         $('thanks_response').update(objresponse[0].firstChild.nodeValue);
},
       onFailure: function() { $('thanks_response').update('Ajax error'); }
   });
   }

</script>
<?php
if (!$leftthanks) print("<tr><td align=\"left\"> </td><td><div id=\"thanks_response\"><input type=\"button\" OnClick=\"thanks_ajax();\" value=\"Obrigado!\"></td></tr>\n");

 

thanks.js

function leavethanks (id) {
   id = parseInt(id);
   new Ajax.Request('thanks_ajax.php', {method: 'get', parameters: 'topico='+id, onSuccess:function (t) { document.getElementById('thanksdiv_add').innerHTML = t.responseText; }});
   new Ajax.Request('thanks_ajax.php', {method: 'get', parameters: 'display=1&topico='+id, onSuccess:function (t) { document.getElementById('thanksdiv').innerHTML = t.responseText; }});

   document.thanksform.submit.disabled = true;
}

 

thanks_ajax.php

<?php
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");

require_once("funct.php");
dbconn(false);
if (!$usu) die;

$id = (int)$_GET['topico'];

if (!is_valid_id($id)) die;

$res = mysql_query("SELECT `THANKS` FROM TB_THANKS WHERE ID=$id");
$row = mysql_fetch_assoc($res);
mysql_free_result($res);
if (!$row) die;

$thanksl = explode(",", $row['THANKS']);
$thanks = "";

if ($_GET["display"] == 1) {
   foreach ($thanksl as $u) {
       $thanks .= ($i>0)?", $u":$u;
       $i++;
   }
   if (!$thanks)
       $thanks = "Nenhum ainda.";
   die($thanks);
}

if (in_array($usu['username'], $thanksl)) die("Você já agradeceu neste topico.");

mysql_query(sprintf("UPDATE `TB_THANKS` SET THANKS = CONCAT_WS(',', `thanks`, %s) WHERE `id`=%d", sqlesc($usu['username']), $id)) or die(mysql_error());

echo "Agradecimento adicionado!.";
?>

 

O unico problema que acontece no FF e no chrome, é que quando ha muitos agradecimentos, e eu, por exemplo vou la agradecer, a tela estoura na largura...

Mas so me ajudando com o problema de fazer funcionar no IE ja ta bao d+

 

abraçao

Compartilhar este post


Link para o post
Compartilhar em outros sites

Cara estou com o mesmo problema, somento no IE9 não consigo fazer consultas ajax usando o https. Nos demais, vai que vai.

Você já achou uma solução?

 

Abs

Compartilhar este post


Link para o post
Compartilhar em outros sites

Usa a meta para navegar forçado pelo IE8.

Não sei porque mas é um bug do IE9 rejeitar consultas quando estamos em https.

 

<meta http-equiv="X-UA-Compatible" content="IE=8"/>

 

Tem que ser a primeira coisa após a <head>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="pt-BR">
 <head>
   <meta http-equiv="X-UA-Compatible" content="IE=8"/>

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.