Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [JS] innerHTML bez tagów
cysioland
post
Post #1





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 14.05.2009

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


Mam problem. Otóż innerHTML wyświetla tekst,ale nie wynik działania tagów html ex. buttony,p style="align" itd. Robię małe okienko wyświetlające buttona.
Oto kod:

index.xhtml:
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" lang="pl">
  3. <head>
  4. <meta http-equiv="content-type"
  5. content="text/html; charset=UTF-8" />
  6. <style type="text/css">
  7. body{background-color: #620000;height: 100%}
  8. h1{margin-bottom: 5px;}
  9. #header{background-image: url(drewno.png);margin-bottom: 5px;text-align: center}
  10. #left{background-image: url(drewno.png);margin-top: 0;margin-right: 5px;width: 200px;float: left;margin-bottom: 5px}
  11. #center{background-image: url(drewno.png);margin-top: 0;margin-right: 5px;width: 590px;float: left;margin-bottom: 5px}
  12. #right{background-image: url(drewno.png);margin-top: 0;margin-right: 0;width: 200px;float: right;margin-bottom: 5px}
  13. #ads{background-image: url(drewno.png);margin-top: 5px;clear: both}
  14. #footer{background-image: url(drewno.png);margin-top: 5px}
  15. #hidden{visiblity: hidden}
  16. </style>
  17. <script type="text/javascript">
  18. function zmiana2(){
  19. document.getElementById('worldlist').innerHTML = '<button onclick="zmiana()">Loguj</button>';
  20. }
  21. function zmiana()
  22. {
  23. document.getElementById('worldlist').innerHTML = 'test<input type="button" value="x" onclick="zmiana2()" />';
  24. }
  25. </script>
  26. <title>Osadnicy</title>
  27. </head>
  28. <body>
  29. <div id="header">
  30. <h1>Osadnicy - Załóż miasto i
  31. rozbudowuj je</h1>
  32. </div>
  33. <div id="wrapper">
  34. <div id="left">Statystyki,ile online,kto online,kto
  35. najnowszy
  36. </div>
  37. <div id="center">
  38. Ogłoszenia,zachęta do rejestracji itp.
  39. </div>
  40. <div id="right">Wejście do gry,logowanie<br />
  41. <div id="hidden">
  42. <div id="worldlist"><button type="button"
  43. onclick="zmiana()">Loguj</button></div>
  44. </div>
  45. </div>
  46. <div id="ads">Jakaś reklama</div>
  47. <div id="footer">Š <a href="http://cysioland.cba.pl/">Cysioland</a>
  48. 2009</div>
  49. </div>
  50. </body>
  51. </html>


Proszę o pomoc,
Cysioland

Ten post edytował cysioland 30.06.2009, 09:52:11
Go to the top of the page
+Quote Post
erix
post
Post #2





Grupa: Moderatorzy
Postów: 15 467
Pomógł: 1451
Dołączył: 25.04.2005
Skąd: Szczebrzeszyn/Rzeszów




Cytat
Otóż innerHTML wyświetla tekst,ale nie wynik działania tagów html ex. buttony,p style="align" itd.

Wrzuć gdzieś działający kod.
Go to the top of the page
+Quote Post
cysioland
post
Post #3





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 14.05.2009

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


A co to znaczy "działający"?
Go to the top of the page
+Quote Post
erix
post
Post #4





Grupa: Moderatorzy
Postów: 15 467
Pomógł: 1451
Dołączył: 25.04.2005
Skąd: Szczebrzeszyn/Rzeszów




Wyślij go na jakiś serwer. (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif)

Nie przesadzaj, nie każdy będzie ściągał do siebie i sprawdzał. Jeśli Ci zależy na pomocy, wysil się trochę u postaraj się ułatwić wszystko maksymalnie, bo nie jesteś jedyny.
Go to the top of the page
+Quote Post
cysioland
post
Post #5





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 14.05.2009

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


Już:
cysiotest.yoyo.pl/index.xhtml
Go to the top of the page
+Quote Post
erix
post
Post #6





Grupa: Moderatorzy
Postów: 15 467
Pomógł: 1451
Dołączył: 25.04.2005
Skąd: Szczebrzeszyn/Rzeszów




Yyy, ale przecież to działa...
Go to the top of the page
+Quote Post
cysioland
post
Post #7





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 14.05.2009

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


Tak,ale po kliknięciu w buttona drugi się nie pokazuje
Go to the top of the page
+Quote Post
nospor
post
Post #8





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Cytat
Tak,ale po kliknięciu w buttona drugi się nie pokazuje
mi tam sie pokazuje. uzywam opery. a ty czego?
Go to the top of the page
+Quote Post
cysioland
post
Post #9





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 14.05.2009

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


Mozilla Firefox 3.0.11
Go to the top of the page
+Quote Post
nospor
post
Post #10





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




durny FF traktuje mi te strone jako plik do pobrania... weź nie bądz taki "trendy" i zmieni rozszerzenie z xhtml na html (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)
Go to the top of the page
+Quote Post
cysioland
post
Post #11





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 14.05.2009

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


Powiedz to Kompozerowi opartemu na Gecko.

cysiotest.yoyo.pl/testy


Ten post edytował cysioland 30.06.2009, 12:07:10
Go to the top of the page
+Quote Post
erix
post
Post #12





Grupa: Moderatorzy
Postów: 15 467
Pomógł: 1451
Dołączył: 25.04.2005
Skąd: Szczebrzeszyn/Rzeszów




To jest Twój problem. (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif)

Wszystko przecież działa, nie zawracaj gitary.
Go to the top of the page
+Quote Post
nospor
post
Post #13





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




pod FF 3.0.11 tez dziala bez zarzutu (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
cysioland
post
Post #14





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 14.05.2009

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


Na pewno po kliknięciu w loguj pojawia się tam "x"?
Go to the top of the page
+Quote Post
nospor
post
Post #15





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




nie, pojawiają mi sie biale myszki.... (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)
Tak, napewno pojawia sie tam x. Co jak co, ale akurat przykladowo moderator nie wymysla sobie historii jak to potrafią robić "zwykli" uzytkownicy (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg) (nie mowie o tobie)

ps: teraz juz sie nie pojawia X... teraz juz nic sie nie pojawia.... usunales strone?
Go to the top of the page
+Quote Post
cysioland
post
Post #16





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 14.05.2009

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


cysiotest.yoyo.pl/testy
Go to the top of the page
+Quote Post
nospor
post
Post #17





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




przykro mi, ale nadal dziala. X jak sie pokazywal tak sie pokazuje (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) Malo tego, jak nacisne na X to znowu mam LOGIN i tak w kołko (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

Sprawdz na innej przegladarce. Pewnie do FF wrzuciles za duzo smieci (dodatkow)
Go to the top of the page
+Quote Post
cysioland
post
Post #18





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 14.05.2009

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


Działa. Pomogła zmiana rozszerzenia i wysłanie na serwer.

Ten post edytował cysioland 30.06.2009, 12:19:53
Go to the top of the page
+Quote Post

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: 23.08.2025 - 05:22