Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 11

Discussione: Problema Ajax IE

  1. #1

    Problema Ajax IE

    Ciao a tutti nella mia applicazione web ho previsto in alcune pagine con 2 select
    e se viene attivata la prima popola tramite Ajax la 2a con i browser Firefox e Chrome funziona mentre con IE no come mai?? posto un esempio di codice

    codice:
    js
    function GetXmlHttpObject(handler)  
    {  
    	var objXMLHttp=null;  
    	if (window.XMLHttpRequest)  
    	{  
    		objXMLHttp=new XMLHttpRequest();  
    	}  
    	else if (window.ActiveXObject)  
    	{  
    		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");  
    	}  
    	return objXMLHttp;  
    }
    
    
    
    
    function popola(url,project,sel)
    {  
    	if (url.length==0)  
    	{  
    		document.getElementById("txtResult").innerHTML="";  
    		return;  
    	} 
    
    	xmlHttp=GetXmlHttpObject();
    
    	if (xmlHttp==null)  
    	{  
    		alert ("Browser does not support HTTP Request");  
    		return;  
    	}
    	url=url+"?projectID="+project;
    	
    	if (sel==document.getElementById("projectName")){
    				xmlHttp.onreadystatechange=stateChanged;
    	}
    	if (sel==document.getElementById("monProject")){
    		xmlHttp.onreadystatechange=stateChanged2;
    	}
    	if (sel==document.getElementById("monCostProject")){
    		xmlHttp.onreadystatechange=stateChanged3;
    	}
    	if (sel==document.getElementById("updateProject")){
    		xmlHttp.onreadystatechange=stateChanged4;
    	}
    	
    	xmlHttp.open("GET", url, true);
    	xmlHttp.send(null);   
    }
    
    function stateChanged()
    {
    
    	//alert("stateChanged");
    	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    	{
    		document.getElementById("projectrelease").innerHTML=xmlHttp.responseText;
    	}
    	else
    	{
    		//  alert("Qui");      
    	}
    }

    Grazie

  2. #2
    Per completezza il mio Internet Explorer è il 9 a 64 bit

    Ho anche aggiunto nella costruzione della url un numero casuale ma comunque non funziona

    codice:
    js
    
    url=url+"&sid="+Math.random();




  3. #3
    Nessuno può aiutarmi?

  4. #4
    la consolle degli errori cosa dice?
    Questa volta, più che un voto.. è favoreggiamento.

  5. #5
    nulla

  6. #6
    prova a modificare la parte di IE sul call del xmlHTTP

    Codice PHP:
    //se il browser è IE    
            
    } else if (window.ActiveXObject) {
                try {
                
    objXMLHttp = new ActiveXObject("Msxml2.XMLHTTP");
                } catch (
    e) {
                    try {
                    
    objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
                    } catch (
    e) {
                        
    objXMLHttp false;
                    }
                }
            } 
    Questa volta, più che un voto.. è favoreggiamento.

  7. #7
    ho modificato ma niente ma è un problema a livello di codice o può essere anche un problema del mio browser IE???

  8. #8
    Codice PHP:
        if (sel==document.getElementById("projectName")){
                    
    xmlHttp.onreadystatechange=stateChanged;
        }
        if (
    sel==document.getElementById("monProject")){
            
    xmlHttp.onreadystatechange=stateChanged2;
        }
        if (
    sel==document.getElementById("monCostProject")){
            
    xmlHttp.onreadystatechange=stateChanged3;
        }
        if (
    sel==document.getElementById("updateProject")){
            
    xmlHttp.onreadystatechange=stateChanged4;
        } 
    questa parte non la capisco....
    Questa volta, più che un voto.. è favoreggiamento.

  9. #9
    perchè questa operazione la ripeto in 3 punti diversi e in base alla select ke arriva deve riempire 3 campi diversi

  10. #10
    riesci gentilmente a ricostruirmi il flussso di azioni che devi compiere...

    mi posti anche la parte di html interessata con le select?

    cosa cambia tra le 4 "stateChanged"??
    Questa volta, più che un voto.. è favoreggiamento.

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 © 2024 vBulletin Solutions, Inc. All rights reserved.