Visualizzazione dei risultati da 1 a 2 su 2

Discussione: Chat con ajax...e IE

  1. #1

    Chat con ajax...e IE

    Salve a tutti...
    In una chat uso questo script che funziona alla perfezione ...tranne che chiaramente su IE......a parte l'ironia , qualcuno mi da una mano per farlo andare ache su internet explorer.

    // JavaScript Document
    function Aggiorna()
    {
    return Richiesta();
    }
    window.setInterval("Aggiorna()", 3000)

    var XMLHTTP;

    function Richiesta()
    {
    XMLHTTP = RicavaBrowser(CambioStato);
    XMLHTTP.open("GET", "ajax.asp", true);
    XMLHTTP.send(null);
    }

    function CambioStato()
    {
    if (XMLHTTP.readyState == 4)
    {
    var R = document.getElementById("CHAT");
    R.innerHTML = XMLHTTP.responseText;
    }
    }

    function RicavaBrowser(QualeBrowser)
    {
    if (navigator.userAgent.indexOf("MSIE") != (-1))
    {
    var Classe = "Msxml2.XMLHTTP";
    if (navigator.appVersion.indexOf("MSIE 5.5") != (-1));
    {
    Classe = "Microsoft.XMLHTTP";
    }
    try
    {
    OggettoXMLHTTP = new ActiveXObject(Classe);
    OggettoXMLHTTP.onreadystatechange = QualeBrowser;
    return OggettoXMLHTTP;
    }
    catch(e)
    {
    alert("Errore: l'ActiveX non verrà eseguito!");
    }
    }
    else if (navigator.userAgent.indexOf("Mozilla") != (-1))
    {
    OggettoXMLHTTP = new XMLHttpRequest();
    OggettoXMLHTTP.onload = QualeBrowser;
    OggettoXMLHTTP.onerror = QualeBrowser;
    return OggettoXMLHTTP;
    }
    else
    {
    alert("L'esempio non funziona con altri browser!");
    }
    }


    grazie

  2. #2
    Nessuno mi aiuta

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.