Torna indietro   Hardware Upgrade Forum > Software > Programmazione

Motorola edge 70: lo smartphone ultrasottile che non rinuncia a batteria e concretezza
Motorola edge 70: lo smartphone ultrasottile che non rinuncia a batteria e concretezza
Motorola edge 70 porta il concetto di smartphone ultrasottile su un terreno più concreto e accessibile: abbina uno spessore sotto i 6 mm a una batteria di capacità relativamente elevata, un display pOLED da 6,7 pollici e un comparto fotografico triplo da 50 MP. Non punta ai record di potenza, ma si configura come alternativa più pragmatica rispetto ai modelli sottili più costosi di Samsung e Apple
Display, mini PC, periferiche e networking: le novità ASUS al CES 2026
Display, mini PC, periferiche e networking: le novità ASUS al CES 2026
Sono molte le novità che ASUS ha scelto di presentare al CES 2026 di Las Vegas, partendo da una gamma di soluzioni NUC con varie opzioni di processore passando sino agli schermi gaming con tecnologia OLED. Il tutto senza dimenticare le periferiche di input della gamma ROG e le soluzioni legate alla connettività domestica
Le novità ASUS per il 2026 nel settore dei PC desktop
Le novità ASUS per il 2026 nel settore dei PC desktop
Molte le novità anticipate da ASUS per il 2026 al CES di Las Vegas: da schede madri per processori AMD Ryzen top di gamma a chassis e ventole, passando per i kit di raffreddamento all in one integrati sino a una nuova scheda video GeForce RTX 5090. In sottofondo il tema dell'intelligenza artificiale con una workstation molto potente per installazioni non in datacenter
Tutti gli articoli Tutte le news

Vai al Forum
Rispondi
 
Strumenti
Old 28-01-2008, 11:14   #1
Lim
Senior Member
 
L'Avatar di Lim
 
Iscritto dal: Dec 2000
Messaggi: 501
[AJAX] Problema con IE6

Devo implementare una pagina web con delle SELECT dinamiche, la classica procedura di selezione della NAZIONE, poi della REGIONE ecc...

Su FireFox nessun problema ma su IE6 non va, la chiamata alla funzione sembra non avvenire affatto, quindi dopo aver selezionato la NAZIONE, non compare la SELECT per le REGIONI.

Incollo qui il codice

Codice PHP:
<script type="text/javascript">
// inizializzo le funzioni basilari di AJAX per la selezione delle REGIONI

var myRequest null;

function 
CreateXmlHttpReq(handler) {
  var 
xmlhttp null;
  try {
    
xmlhttp = new XMLHttpRequest();
  } catch(
e) {
    try {
        
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch(
e) {
        
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
  
xmlhttp.onreadystatechange handler;
  return 
xmlhttp;
}

function 
myHandler() {
    if (
myRequest.readyState == && myRequest.status == 200) {
        
document.getElementById("provincia");
        
e.innerHTML myRequest.responseText;
    }
}

function 
provincia(regione){

    
     var 
document.getElementById("provincia");
    
myRequest CreateXmlHttpReq(myHandler);
    
myRequest.open("GET","provincia.php?regione="+escape(regione));
    
myRequest.send(null);
    
}
</script>


<div id="regioni">
        <select name="paese" id="q14" >
             <option title="paese" onclick="provincia('IT')" value="IT">Italy
                <option title="paese" onclick="provincia('UK')" value="UK">United Kingdom
                    
        </select>
</div>


<div id="provincia">
        <em>Choose the country!</em>
</div> 
Il file provincia.php viene chiamato e contiene la connessione al DB con la relativa funzione di visualizzazione dell'elenco delle regioni (niente di particolare...)
Lim è offline   Rispondi citando il messaggio o parte di esso
Old 28-01-2008, 11:40   #2
kk3z
Senior Member
 
L'Avatar di kk3z
 
Iscritto dal: Nov 2003
Messaggi: 980
Codice PHP:
<script type="text/javascript">
function 
CreateXmlHttpReq(handler) {
  var 
xmlhttp null;
  try {
    
xmlhttp = new XMLHttpRequest();
  } catch(
e) {
    try {
        
//Io uso "MSXML2.XMLHTTP.3.0" e funziona con tutti gli IE
        //xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        
xmlhttp = new ActiveXObject("MSXML2.XMLHTTP.3.0");
    } catch(
e) {
        
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
  return 
xmlhttp;
}

function 
provincia(select)
{
    var 
provincia select.optionsselect.selectedIndex ].value;
    var 
myRequest CreateXmlHttpReq();
    
myRequest.open("GET""provincia.php?regione="+escape(provincia), true);
    
myRequest.onreadystatechange = function() {
        if (
this.readyState == 4) {
            var 
document.getElementById("provincia");
            
e.innerHTML this.responseText;
        }
    }
    
myRequest.send(null);
    
}
</script>


<div id="regioni">
        <select name="paese" id="q14" onchange="provincia(this)">
            <option title="paese" value="IT">Italy
            <option title="paese" value="UK">United Kingdom
        </select>
</div> 

Ultima modifica di kk3z : 28-01-2008 alle 11:42.
kk3z è offline   Rispondi citando il messaggio o parte di esso
Old 28-01-2008, 12:41   #3
Lim
Senior Member
 
L'Avatar di Lim
 
Iscritto dal: Dec 2000
Messaggi: 501
mmm... cosi non funziona per niente...
Lim è offline   Rispondi citando il messaggio o parte di esso
Old 28-01-2008, 16:04   #4
kk3z
Senior Member
 
L'Avatar di kk3z
 
Iscritto dal: Nov 2003
Messaggi: 980
nessun errore javascript?
kk3z è offline   Rispondi citando il messaggio o parte di esso
Old 28-01-2008, 18:06   #5
tomminno
Senior Member
 
Iscritto dal: Oct 2005
Messaggi: 3306
Sicuro di avere gli ActiveX abilitati su IE?
tomminno è offline   Rispondi citando il messaggio o parte di esso
Old 29-01-2008, 10:05   #6
Lim
Senior Member
 
L'Avatar di Lim
 
Iscritto dal: Dec 2000
Messaggi: 501
ho controllato, sono abilitati...
Lim è offline   Rispondi citando il messaggio o parte di esso
Old 29-01-2008, 11:37   #7
vladix
Member
 
L'Avatar di vladix
 
Iscritto dal: Jan 2008
Città: roma
Messaggi: 296
ciao , questo e un pezzettino di codice che io uso nelle mie applicazioni , magari questo funziona ( se no ti posto il file x intero )

Codice:
function Ajax (action , queryString){

     this.getXMLInstance = function() {
     var XHR = null,
                    browserUtente = navigator.userAgent.toUpperCase();
        if(typeof(XMLHttpRequest) === "function" || typeof(XMLHttpRequest) === "object"){
                XHR = new XMLHttpRequest();
        }else if(window.ActiveXObject && browserUtente.indexOf("MSIE 4") < 0) {
                if(browserUtente.indexOf("MSIE 5") < 0)
                        XHR = new ActiveXObject("Msxml2.XMLHTTP");
                else
                        XHR = new ActiveXObject("Microsoft.XMLHTTP");
        }
        return XHR;
    }
     
	 
	this.synchronizedMessage = function (){
      var URL = action;
      var ajax = this.getXMLInstance(); 
      var _response = "";
      ajax.open(POST , URL , false);
      ajax.setRequestHeader(CONTENT_TYPE , APP);
      ajax.send(queryString);
      	    if(statusText[ajax.status] == "OK"){
                 _response = ajax.responseText;
	        }else{
	        // alert("Error : " + statusText[ajax.status]);  
	        }  
     return _response;
    }
	
	
	    var CONTENT_TYPE   = "Content-type";
    var APP            = "application/x-www-form-urlencoded";
    var CONTENT_LENGTH = "Content-length";
    var CONNECTION     = "Connection";
    var CLOSE          = "Close";
    var POST           = "POST";
    
		var readyState = {
			INATTIVO:	0,
		  INIZIALIZZATO:	1,
			RICHIESTA:	2,
			RISPOSTA:	3,
			COMPLETATO:	4
		};

		var statusText = new Array();
	
        	statusText[100] = "Continue";
		statusText[101] = "Switching Protocols";
		statusText[200] = "OK";

		statusText[201] = "Created";
		statusText[202] = "Accepted";
		statusText[203] = "Non-Authoritative Information";
		statusText[204] = "No Content";
		statusText[205] = "Reset Content";
		statusText[206] = "Partial Content";
		statusText[300] = "Multiple Choices";
		statusText[301] = "Moved Permanently";
		statusText[302] = "Found";
		statusText[303] = "See Other";
		statusText[304] = "Not Modified";
		statusText[305] = "Use Proxy";
		statusText[306] = "(unused, but reserved)";
		statusText[307] = "Temporary Redirect";
		statusText[400] = "Bad Request";
		statusText[401] = "Unauthorized";
		statusText[402] = "Payment Required";
		statusText[403] = "Forbidden";
		statusText[404] = "Risorsa Non Trovata";
		statusText[405] = "Method Not Allowed";
		statusText[406] = "Not Acceptable";
		statusText[407] = "Proxy Authentication Required";
		statusText[408] = "Request Timeout";
		statusText[409] = "Conflict";
		statusText[410] = "Gone";
		statusText[411] = "Length Required";
		statusText[412] = "Precondition Failed";
		statusText[413] = "Request Entity Too Large";
		statusText[414] = "Request-URI Too Long";
		statusText[415] = "Unsupported Media Type";
		statusText[416] = "Requested Range Not Satisfiable";
		statusText[417] = "Expectation Failed";
		statusText[500] = "Internal Server Error";
		statusText[501] = "Not Implemented";
		statusText[502] = "Bad Gateway";
		statusText[503] = "Service Unavailable";
		statusText[504] = "Gateway Timeout";
		statusText[505] = "HTTP Version Not Supported";
		statusText[509] = "Bandwidth Limit Exceeded";
}

poi nella tua funzione dovresti utilizzarlo + o - cosi
Codice:
function provincia(select)
{
    var provincia = select.options[ select.selectedIndex ].value;
	var ajax = new Ajax("provincia.php" , "regione="+escape(provincia));
	
            var e = document.getElementById("provincia");
            e.innerHTML = ajax.synchronizedMessage();

    }
    
}
cmq io sta roba l'ho sepre usata con java , nn so se cambia qualcosa x php ( ma penso dii no)
vladix è offline   Rispondi citando il messaggio o parte di esso
Old 04-02-2008, 10:58   #8
Lim
Senior Member
 
L'Avatar di Lim
 
Iscritto dal: Dec 2000
Messaggi: 501
ho cercato ancora in rete, ma non trovo alcun aiuto...

Riporto qui sotto tutto il codice che uso, mi sembra corretto, ma ancora non riesco a capire perchè non funziona in IE6...

Codice PHP:
var myRequest null;


function 
CreateXmlHttpReq(handler) {
  var 
xmlhttp null;
  try {
    
xmlhttp = new XMLHttpRequest();
  } catch(
e) {
    try {
        
xmlhttp = new ActiveXObject("MSXML2.XMLHTTP.3.0");
    } catch(
e) {
        
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
  
xmlhttp.onreadystatechange handler;
  return 
xmlhttp;
}

function 
myHandler() {
    if (
myRequest.readyState == && myRequest.status == 200) {
        
document.getElementById("provincia");
        
e.innerHTML myRequest.responseText;
    }
}


function 
provincia(regione){

    
     var 
document.getElementById("provincia");
    
myRequest CreateXmlHttpReq(myHandler);
    
myRequest.open("GET","provincia.php?regione="+escape(regione));
    
myRequest.send(null);
    

Lim è offline   Rispondi citando il messaggio o parte di esso
Old 04-02-2008, 13:17   #9
texerasmo
Senior Member
 
Iscritto dal: Feb 2003
Città: Formia
Messaggi: 1545
non so se ti puo essere d'aiuto prevoa a vedere

su http://www.prototypejs.org/
__________________
Il portale delle infomazioni di Latina e Provincia
Giralatina.it e’ nato con il preciso intento di promuovere varie attività che si svolgono nella provincia di Latina
http://www.giralatina.it
Il Blog dei Pendolari
http://www.giralatina.it/blog/mybloggie/index.php
texerasmo è offline   Rispondi citando il messaggio o parte di esso
 Rispondi


Motorola edge 70: lo smartphone ultrasottile che non rinuncia a batteria e concretezza Motorola edge 70: lo smartphone ultrasottile che...
Display, mini PC, periferiche e networking: le novità ASUS al CES 2026 Display, mini PC, periferiche e networking: le n...
Le novità ASUS per il 2026 nel settore dei PC desktop Le novità ASUS per il 2026 nel settore de...
Le novità MSI del 2026 per i videogiocatori Le novità MSI del 2026 per i videogiocato...
I nuovi schermi QD-OLED di quinta generazione di MSI, per i gamers I nuovi schermi QD-OLED di quinta generazione di...
NVIDIA ed Eli Lilly: un laboratorio AI c...
Un PC da gaming costa troppo? Con questa...
Non solo iPhone: è questa la vera...
Rigenerazione territoriale: Huawei trasf...
Batteria e-bike a rischio incendio? L'in...
Assetto Corsa Evo: i dintorni del Nordsc...
HP pronta a introdurre memorie cinesi in...
Apple supera Samsung e conquista la lead...
L'UE vuole il nostro feedback sull'open ...
Polestar chiude in crescita il 2025, nuo...
Stranger Things sbarca sui device Samsun...
Grok finisce sotto indagine nel Regno Un...
Arriva in Italia il nuovo marchio iCAUR,...
Obiettivo raggiunto: mille tablet OPPO c...
Nintendo nega l'uso dell'intelligenza ar...
Chromium
GPU-Z
OCCT
LibreOffice Portable
Opera One Portable
Opera One 106
CCleaner Portable
CCleaner Standard
Cpu-Z
Driver NVIDIA GeForce 546.65 WHQL
SmartFTP
Trillian
Google Chrome Portable
Google Chrome 120
VirtualBox
Tutti gli articoli Tutte le news Tutti i download

Strumenti

Regole
Non Puoi aprire nuove discussioni
Non Puoi rispondere ai messaggi
Non Puoi allegare file
Non Puoi modificare i tuoi messaggi

Il codice vB è On
Le Faccine sono On
Il codice [IMG] è On
Il codice HTML è Off
Vai al Forum


Tutti gli orari sono GMT +1. Ora sono le: 23:33.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Served by www3v