Pagina 1 di 4 1 2 3 ... ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 38
  1. #1
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560

    Errori nella visualizzazione della pagina: IE

    Internet explorer mi da errore al completamento dell'apertura della pagina
    perchè va in errore il browser?

    il codice è

    codice:
    var xmlHttp = getXmlHttpObject();
    var busy = false;
    var requests = new Array();
    
    function checkQueue() {
    	if(!busy && requests.length > 0) {
    		sendRequest(requests.shift());
    	}
    }
    function sendRequest(req) {
    	busy = true;
    	xmlHttp.open('GET', req, true);
    	xmlHttp.onreadystatechange = stateChanged;
    	xmlHttp.send(null);
    }
    function loadList(tb, id){
    	requests.push('request.php?table='+tb+'&id='+id);
    }
    function clearList(listId) {
    	var select = document.getElementById(listId);
    	//Elimina i tag options tranne il primo (--- Selezionare xxx ---)
    	while (select.options.length > 1) {
    		select.remove(1);
    	} 
    }
    function addOption(select, value, text) {
    	//Aggiunge un elemento <option> ad una lista <select>
    	var option = document.createElement("option");
    	option.value = value,
    	option.text = text;
    	try {
    		select.add(option, null);
    	} catch(e) {
    		//Per Internet Explorer
    		select.add(option);
    	}
    }
    function getSelected(select) {
    	//Ritorna il valore dell'elemento <option> selezionato in una lista
    	return select.options[select.selectedIndex].value;
    }
    function stateChanged() {
    	if(xmlHttp.readyState == 4) {
    		busy = false;
    		//Stato OK
    		if (xmlHttp.status == 200) {
    			var resp = xmlHttp.responseText;
    			
    			if(resp) {
    				//Le coppie di valori nella striga di risposta sono separate da ;
    				var values = resp.split(';');
    				//Il primo elemento è l'ID della lista.
    				var listId = values.shift();
    				var select = document.getElementById(listId);
    				clearList(listId);
    				var limit = values.length;
    				
    				for(i=0; i < limit; i++) {
    					var pair = values[i].split('|');
    					//aggiunge un elemento <option>
    					addOption(select, pair[0], pair[1]);
    				}
    			}
    		}
    	}
    }
    
    function getXmlHttpObject()
    {
      var xmlHttp=null;
      try
        {
        // Firefox, Opera 8.0+, Safari
        xmlHttp=new XMLHttpRequest();
        }
      catch (e)
        {
        // Internet Explorer
        try
          {
          xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
          }
        catch (e)
          {
          xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
          }
        }
      return xmlHttp;
    }

  2. #2
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560
    scusate l'errore che mi da il browser è qui:

    codice:
    <script type="text/javascript">
    //<![CDATA[
    loadList('persone', 0);
    loadList('tipo', 0);
    var queueWatcher = setInterval(checkQueue, 200);
    //]]>
    </script>
    cosa c'è che da fastidio a IE?

  3. #3
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560
    codice:
    var queueWatcher = setInterval(checkQueue, 200);
    quasta variabile mi da errore con Internet Explorer, qualcuno sa perchè?

  4. #4
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560
    codice:
    var queueWatcher = setInterval(checkQueue, 200);
    quasta variabile mi da errore in basso a sinistra(triangolino giallo!) nel browser con Internet Explorer, chi mi aiuta a capire il perchè?

    grazie

  5. #5
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560
    up

  6. #6
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560
    up

  7. #7
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560
    up

  8. #8
    Moderatore di Annunci siti web, Offro lavoro/collaborazione, Cerco lavoro L'avatar di cavicchiandrea
    Registrato dal
    Aug 2001
    Messaggi
    26,133
    Porva cosi:
    var queueWatcher = setInterval(function(){checkQueue()}, 200);



    P.S. Riflessione di iniziare a studiare serimente il javascript l'hai preso in considerazione? Nel tuo interesse potresti risovere molto prima.
    Cavicchi Andrea
    Problemi con javascript, jquery, ajax clicca qui

  9. #9
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560
    Grazie per la risposta, ho provato ma da sempre errore,

    la pagina che richiama "loadList" è questa:

    codice:
    var xmlHttp = getXmlHttpObject();
    var busy = false;
    var requests = new Array();
    
    function checkQueue() {
    	if(!busy && requests.length > 0) {
    		sendRequest(requests.shift());
    	}
    }
    function sendRequest(req) {
    	busy = true;
    	xmlHttp.open('GET', req, true);
    	xmlHttp.onreadystatechange = stateChanged;
    	xmlHttp.send(null);
    }
    function loadList(tb, id){
    	requests.push('request.php?table='+tb+'&id='+id);
    }
    function clearList(listId) {
    	var select = document.getElementById(listId);
    	//Elimina i tag options tranne il primo (--- Selezionare xxx ---)
    	while (select.options.length > 1) {
    		select.remove(1);
    	} 
    }
    function addOption(select, value, text) {
    	//Aggiunge un elemento <option> ad una lista <select>
    	var option = document.createElement("option");
    	option.value = value,
    	option.text = text;
    	try {
    		select.add(option, null);
    	} catch(e) {
    		//Per Internet Explorer
    		select.add(option);
    	}
    }
    function getSelected(select) {
    	//Ritorna il valore dell'elemento <option> selezionato in una lista
    	return select.options[select.selectedIndex].value;
    }
    function stateChanged() {
    	if(xmlHttp.readyState == 4) {
    		busy = false;
    		//Stato OK
    		if (xmlHttp.status == 200) {
    			var resp = xmlHttp.responseText;
    			
    			if(resp) {
    				//Le coppie di valori nella striga di risposta sono separate da ;
    				var values = resp.split(';');
    				//Il primo elemento è l'ID della lista.
    				var listId = values.shift();
    				var select = document.getElementById(listId);
    				clearList(listId);
    				var limit = values.length;
    				
    				for(i=0; i < limit; i++) {
    					var pair = values[i].split('|');
    					//aggiunge un elemento <option>
    					addOption(select, pair[0], pair[1]);
    				}
    			}
    		}
    	}
    }
    
    function getXmlHttpObject()
    {
      var xmlHttp=null;
      try
        {
        // Firefox, Opera 8.0+, Safari
        xmlHttp=new XMLHttpRequest();
        }
      catch (e)
        {
        // Internet Explorer
        try
          {
          xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
          }
        catch (e)
          {
          xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
          }
        }
      return xmlHttp;
    }
    purtroppo non ho molto tempo per studiare anche js

  10. #10
    Moderatore di Annunci siti web, Offro lavoro/collaborazione, Cerco lavoro L'avatar di cavicchiandrea
    Registrato dal
    Aug 2001
    Messaggi
    26,133
    Originariamente inviato da Lino80
    purtroppo non ho molto tempo per studiare anche js
    Ok, anch'io ho poco tempo di studiarmi lo script, attendi altre soluzioni
    Cavicchi Andrea
    Problemi con javascript, jquery, ajax clicca qui

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.