Torna indietro   Hardware Upgrade Forum > Software > Programmazione

ASUS Expertbook PM3: il notebook robusto per le aziende
ASUS Expertbook PM3: il notebook robusto per le aziende
Pensato per le necessità del pubblico d'azienda, ASUS Expertbook PM3 abbina uno chassis particolrmente robusto ad un pannello da 16 pollici di diagonale che avantaggia la produttività personale. Sotto la scocca troviamo un processore AMD Ryzen AI 7 350, che grazie alla certificazione Copilot+ PC permette di sfruttare al meglio l'accelerazione degli ambiti di intelligenza artificiale
Test ride con Gowow Ori: elettrico e off-road vanno incredibilmente d'accordo
Test ride con Gowow Ori: elettrico e off-road vanno incredibilmente d'accordo
Abbiamo provato per diversi giorni una new entry del mercato italiano, la Gowow Ori, una moto elettrica da off-road, omologata anche per la strada, che sfrutta una pendrive USB per cambiare radicalmente le sue prestazioni
Recensione OnePlus 15: potenza da vendere e batteria enorme dentro un nuovo design
Recensione OnePlus 15: potenza da vendere e batteria enorme dentro un nuovo design
OnePlus 15 nasce per alzare l'asticella delle prestazioni e del gaming mobile. Ma non solo, visto che integra un display LTPO 1,5K a 165 Hz, OxygenOS 16 con funzioni AI integrate e un comparto foto con tre moduli da 50 MP al posteriore. La batteria da 7.300 mAh con SUPERVOOC 120 W e AIRVOOC 50 W è la ciliegina sulla torta per uno smartphone che promette di offrire un'esperienza d'uso senza alcun compromesso
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


ASUS Expertbook PM3: il notebook robusto per le aziende ASUS Expertbook PM3: il notebook robusto per le ...
Test ride con Gowow Ori: elettrico e off-road vanno incredibilmente d'accordo Test ride con Gowow Ori: elettrico e off-road va...
Recensione OnePlus 15: potenza da vendere e batteria enorme dentro un nuovo design   Recensione OnePlus 15: potenza da vendere e batt...
AMD Ryzen 5 7500X3D: la nuova CPU da gaming con 3D V-Cache per la fascia media AMD Ryzen 5 7500X3D: la nuova CPU da gaming con ...
SONY BRAVIA 8 II e BRAVIA Theatre System 6: il cinema a casa in formato compatto SONY BRAVIA 8 II e BRAVIA Theatre System 6: il c...
Bonus Elettrodomestici 2025, si parte: c...
Jeff Bezos torna al comando, stavolta di...
Anthesi sceglie OVHcloud per digitalizza...
Cube presenta Trike Flatbed Hybrid 750, ...
Call of Duty Black Ops 7 peggio di Infin...
L'Italia è il secondo mercato per...
Wi-Fi superveloce anche in giardino? FRI...
La Ford Focus va ufficialmente in pensio...
Booking.com integra Revolut Pay: nasce i...
DGX Spark a 175 fps con ray tracing su C...
Red Dead Redemption 2 Enhanced è ...
3Dfx Voodoo 2, una GPU nata con la scade...
Apple Watch: la Mela dovrà versar...
TIM e Nokia insieme per potenziare il 5G...
Musk lancia la nuova era dei DM su X con...
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: 21:41.


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