Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [AJAX] Odświeżania skryptów js
Lirdoner
post 12.08.2010, 16:51:21
Post #1





Grupa: Zarejestrowani
Postów: 500
Pomógł: 1
Dołączył: 29.09.2009

Ostrzeżenie: (0%)
-----


Witam, mam taki problem, że pobieram dane ajaxem z osobnej stronki i wyświetlam je u siebie w divie
Problem w tym, że dane które pobieram mają w sobie javascript i gdy wyświetle je w tym divie skrypty te się nie wykonują

Kod
function load(strona) {
        var ajaxRequest;
    
    try{
        ajaxRequest = new XMLHttpRequest();
    } catch (e){
        try{
            ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try{
                ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e){
                alert("Your browser broke!");
                return false;
            }
        }
    }
    // Create a function that will receive data sent from the server
    ajaxRequest.onreadystatechange = function(){
        if(ajaxRequest.readyState == 4){
            var ajaxDisplay = document.getElementById('home');
            ajaxDisplay.innerHTML = ajaxRequest.responseText;
        }
        else {
            var ajaxDisplay = document.getElementById('home');
            ajaxDisplay.innerHTML = "<center><img src='images/loading.gif' /></center>";
        }
    }
        ajaxRequest.open("GET", strona, true);
        ajaxRequest.send(null);
    }
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.07.2025 - 04:43