Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Problema AJAX IE errore 600

    Ciao, sto usando ajax su uno script php, funziona tutto tranne in IE
    qui, al momento di scrivere i dati restituiti, IE mi da errore, per l'esattezza


    SCRIPT600: Invalid target element for this operation.

    ecco il codice che lo genera:

    codice:
    if (myRequest.readyState == 4 && myRequest.status == 200) { 
    
       e = document.getElementById("news");
       e.innerHTML = myRequest.responseText; 	  //ERRORE	
    	 			
    document.getElementById('loading_news').style.display = "none"; 		 		
    }
    con gl'altri browser è tutto ok, solo con IE in quella riga da errore.

    Sapete aiutarmi?

  2. #2
    se volete vi metto il codice completo

    codice:
    
    var myRequest = null;
    
    	function CreateXmlHttpReq2(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 myHandler2() {
    		/*alert(myRequest.readyState);
    		alert(myRequest.status);*/
    		if (myRequest.readyState == 4 && myRequest.status == 200) {
    			
    			e = document.getElementById("news");
    			
    			e.innerHTML = myRequest.responseText;
    			
    			alert('ciao');
    			document.getElementById('loading_news').style.display = "none";
    		
    		}
    		
    		
    	}
    	
    	function doWork(categoria) {
    		
    		document.getElementById('loading_news').style.display = "block";
    		
    		var r = Math.random();
    		myRequest = CreateXmlHttpReq2(myHandler2);
    		
    				myRequest.open("GET", "news_home.php?categoria="+categoria+"&rand="+escape(r), true);
    			
    			
    		myRequest.send(null);
    		
    	}

  3. #3
    Ho capito.... IE non accetta innerHTML in oggetti "strani" io lo usavo dentro ad una tr...
    se invece lo si mette in un div oppre td funzione perfettamente

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.