Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> include, jak w PHP
kirkor0
post
Post #1





Grupa: Zarejestrowani
Postów: 80
Pomógł: 0
Dołączył: 18.04.2004

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


Witam!
Jaki jest odpowiednik funkcji include" title="Zobacz w manualu PHP" target="_manual() PHP w JS?

PS. Od razu zaznaczam, że nie mogę użyć document.write('<script src="...')
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
ActivePlayer
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 1 224
Pomógł: 40
Dołączył: 6.07.2004
Skąd: Wuppertal

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


Kod
function include_dom(script_filename) {
    var html_doc = document.getElementsByTagName('head').item(0);
    var js = document.createElement('script');
    js.setAttribute('language', 'javascript');
    js.setAttribute('type', 'text/javascript');
    js.setAttribute('src', script_filename);
    html_doc.appendChild(js);
    return false;
}


http://www.phpied.com/javascript-include/
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 4.10.2025 - 02:10