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

    ajax + pagina con del javascript :dhò: :dhò:

    uso questo codice per usare ajax.. e funziona se carico pagine con del solo testo.. ma se all'interno di queste pagine c'e' del javascript anche un semplice alert(''ciao); questo viene ignorato.. sia in ie che firefox.. qualcuno sa aiutarmi ad estendere questo codice affinche' venga interpretato anche il javascript della pagina chiamata ?

    codice:
    function createXMLHttp() {
        var xmlhttp ;
        try {
            xmlhttp = new XMLHttpRequest(); // Gecko (Firefox, Moz), KHTML (Konqueror, Safari), Opera, Internet Explorer 7
        } catch (e) {
            var MSXML_XMLHTTP_PROGIDS = new Array(
                'MSXML2.XMLHTTP.5.0',  
                'MSXML2.XMLHTTP.4.0',
                'MSXML2.XMLHTTP.3.0',
                'MSXML2.XMLHTTP',      // Internet Explorer 6
                'Microsoft.XMLHTTP'   // Internet Explorer 4,5
            );
            var success = false;
            for (var i=0;i < MSXML_XMLHTTP_PROGIDS.length && !success; i++) {
                try {
                    xmlhttp = new  ActiveXObject(MSXML_XMLHTTP_PROGIDS[i]);
    
                    success = true;
    				
                } catch (e) {}
            }
            if ( !success ) {
                alert('Cant create XMLHttpRequest - not supported');
            }
        }
    	return xmlhttp;
    }
    
    
    
    function getFile(file,callbackFunction) {
        //alert("getFile("+file+")");
        var xmlHttpObj = null;
        xmlHttpObj=createXMLHttp();
    //    xmlHttpObj.open("HEAD", file, true);
    	xmlHttpObj.open('get', file); 
    	var argomenti=arguments;
        //alert("001  :"+argomenti.length);     
        xmlHttpObj.onreadystatechange = function() {
            if (xmlHttpObj.readyState == 4) {
                switch(xmlHttpObj.status) {
                    case 200: // Page found
                    case 304: // Status Code on Opera when page reload
                         this.size = xmlHttpObj.getResponseHeader("Content-Length");
    					 this.text = xmlHttpObj.responseText;
    					 str="callbackFunction(this";
    				     for(j=2;j'+file+'');
    					/*data1=this;
    					for(i in data1){
    						document.write("
    [" + i+ "]    "+data1[i]+""); 
    					}*/
                        return;
                        break;
                }
            }            
        }          
        xmlHttpObj.send(null); 
        delete xmlHttpObj;
    }
    www.3viso.com pubblica i tuoi comunicati stampa
    3viso.net/forum cerca Articolisti 2€ ad articolo.

  2. #2
    metti tutti i javascript nella pagina che chiama....
    saranno riconosciuti e richiamabili anche dalle pagine caricate ....
    Despite of my rage i'm still just a rat in a cage

  3. #3
    ihhh troppo FACILE

    e la pagina che viene creata che crea automaticamente (tramite php) i javascript
    www.3viso.com pubblica i tuoi comunicati stampa
    3viso.net/forum cerca Articolisti 2€ ad articolo.

  4. #4
    (up)
    www.3viso.com pubblica i tuoi comunicati stampa
    3viso.net/forum cerca Articolisti 2€ ad articolo.

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.