Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it
    Registrato dal
    Jun 2006
    Messaggi
    794

    errore in browser_refresh ajax

    Ragazzi ho questa funzione:
    function load(){
    setTimeout("refreshBrowser('#chi_ce','controlla_on line.php')",500);
    }

    e poi metto <boby onload="load()">

    in controlla_online.php effettuo una semplice select dove stampo dei nomi..

    Perchè mi da errore del tipo PREVISTO OGGETTO?
    DOve sbaglio?

  2. #2
    si ma il codice della funzione refreshBrowser ? Posta anche quello...

  3. #3
    Utente di HTML.it
    Registrato dal
    Jun 2006
    Messaggi
    794
    eccola:


    var url = "http://localhost/test/";
    var preload = "<p style='background:#ff0000; color: #ffffff;'>aggiornamento richiesta in corso...</p>";
    function refreshBrowser(id,nomeFile){
    if (document.getElementById) {
    var el=document.getElementById(id);
    }else if (document.layers) {
    var el=document.layers[id];
    }else if (document.all) {
    var el=document.all.id;
    }
    if (typeof XMLHttpRequest != "undefined") {
    x = new XMLHttpRequest();
    }else {
    try {
    x = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e) {
    try {
    x = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch (e){
    x = null;
    }
    }
    }
    if (x) {
    el.innerHTML = preload;
    x.onreadystatechange = function() {
    if (x.readyState == 4 && x.status == 200) {
    el.innerHTML = x.responseText;
    load();
    }
    }
    x.open("GET", url + nomeFile, true);
    x.send(null);
    }
    // return false;
    }

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.