Script ajax non funziona su IE

di Anonimizzato4479 il
1 risposte
Salve,

utilizzo questo script trovato in rete per effettuare una query su db utilizzando ajax per non ricaricare la pagina. Funziona perfettamente su tutti i browser tranne che su IE ... sapreste dirmi perchè e/o dove sbaglio ?

Grazie mille.

Pagina Principale (Prova.html)

<html>
<head>
<script src="jquery-1.3.2.js"></script>
</head>
<body>

<script type="text/javascript">

$(document).ready(function() {
var timer = setInterval ("Reload()", 2000);
var timer = setInterval ("Reload2()", 3000);
});

function Reload(){
$("#dati1").load("prova2.asp");
$("#msg1").ajaxError(function(event, request, settings){
$(this).append(" Error requesting page " + settings.url + "");
});
}

function Reload2(){
$("#dati2").load("prova2.asp");
$("#msg2").ajaxError(function(event, request, settings){
$(this).append(" Error requesting page " + settings.url + "");
});
}
</script>
<div id="dati1"></div>
<br/>
<div id="dati2"></div>

</body>
</html>

Pagina Query = Pagina2.asp  (in verità al momento c'è solamente una funzione per generare numeri random random)

<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Senza nome 1</title>
</head>
<body>
<%
Dim Limite
Limite = 999
Randomize()
'Response.Write CInt((Limite - 1)*Rnd() + 1 )
%>
<table style="width: 150px">
    <tr>
        <td>Numero: </td>
        <td><%=CInt((Limite-1)*Rnd()+1)%></td>
    </tr>
</table>
</body>
</html>

1 Risposte

  • Risolto .... ho trovato in rete il problema di IE .... praticamente non si aggiorna la cache e quindi se ne frega del random ....

    questa la parte di codice da sostituire per prenderlo in giro:

    prima
    $("#dati1").load("prova2.asp");

    dopo
    $("#dati1").load("prova2.asp?rand="+escape(Math.random()));
Devi accedere o registrarti per scrivere nel forum
1 risposte