Article View: pl.comp.lang.javascript
Article #49115Re: innerHTML nie wyświetla tagów html
From: wilq
Date: Wed, 01 Jul 2009 09:05
Date: Wed, 01 Jul 2009 09:05
74 lines
3913 bytes
3913 bytes
On 29 Cze, 11:46, cysioland <cysiol...@o2.pl> wrote:
> 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:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" lang="pl">
> <head>
> <meta http-equiv="content-type"
> content="text/html; charset=UTF-8" />
> <style type="text/css">
> body{background-color: #620000;height: 100%}
> h1{margin-bottom: 5px;}
> #header{background-image: url(drewno.png);margin-bottom: 5px;text-align:
> center}
> #left{background-image: url(drewno.png);margin-top: 0;margin-right:
> 5px;width: 200px;float: left;margin-bottom: 5px}
> #center{background-image: url(drewno.png);margin-top: 0;margin-right:
> 5px;width: 590px;float: left;margin-bottom: 5px}
> #right{background-image: url(drewno.png);margin-top: 0;margin-right:
> 0;width: 200px;float: right;margin-bottom: 5px}
> #ads{background-image: url(drewno.png);margin-top: 5px;clear: both}
> #footer{background-image: url(drewno.png);margin-top: 5px}
> #hidden{visiblity: hidden}
> </style>
> <script language="javascript" type="text/javascript">
> function zmiana2(){
> document.getElementById('worldlist').innerHTML = '<button
> onclick="zmiana()">Loguj</button>';}
>
> function zmiana()
> {
> document.getElementById('worldlist').innerHTML = 'test<input
> type="button" value="x" onclick="zmiana2()" />';}
>
> </script>
> <title>Osadnicy</title>
> </head>
> <body>
> <div id="header">
> <h1>Osadnicy - Załóż miasto i
> rozbudowuj je</h1>
> </div>
> <div id="wrapper">
> <div id="left">Statystyki,ile online,kto online,kto
> najnowszy
> </div>
> <div id="center">
> Ogłoszenia,zachęta do rejestracji itp.
> </div>
> <div id="right">Wejście do gry,logowanie<br />
> <div id="hidden">
> <div id="worldlist"><button type="button"
> onclick="zmiana()">Loguj</button></div>
> </div>
> </div>
> <div id="ads">Jakaś reklama</div>
> <div id="footer">(c) <a href="http://cysioland.cba.pl">Cysioland</a>
> 2009</div>
> </div>
> </body>
> </html>
>
> Proszę o pomoc,
> Cysioland
Zanim zaczniesz robic cos duzego w JS, polecalbym jakies podstawy JS i
developowania w tym. Sciagnij sobie firebug-a oraz firefoxa - znacznie
ulatwia prace. Dodatkowo okreslaj na jakiej przegladarce nie dziala.
Mi np ten kod dziala pod firefoxem wiec ciezko stwierdzic co nie
dziala :P
Technical Details
Message-ID:
<f04ac212-3779-4dae-91b1-e5a176ca1d9b@h18g2000yqj.googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.onet.pl!lublin.pl!uw.edu.pl!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!feeder.news-service.com!feeder.news-service.com!postnews.google.com!h18g2000yqj.googlegroups.com!not-for-mailReferences:
<h2a2gp$ams$1@news.onet.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.onet.pl!lublin.pl!uw.edu.pl!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!feeder.news-service.com!feeder.news-service.com!postnews.google.com!h18g2000yqj.googlegroups.com!not-for-mail From: wilq <wilq32@gmail.com> Newsgroups: pl.comp.lang.javascript Subject: Re: innerHTML nie wyświetla tagów html Date: Wed, 1 Jul 2009 02:05:39 -0700 (PDT) Organization: http://groups.google.com Lines: 75 Message-ID: <f04ac212-3779-4dae-91b1-e5a176ca1d9b@h18g2000yqj.googlegroups.com> References: <h2a2gp$ams$1@news.onet.pl> NNTP-Posting-Host: 192.100.130.7 Mime-Version: 1.0 X-Trace: posting.google.com 1246439142 21937 127.0.0.1 (1 Jul 2009 09:05:42 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 1 Jul 2009 09:05:42 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: h18g2000yqj.googlegroups.com; posting-host=192.100.130.7; posting-account=jHaX5goAAABeCKkyHTyV6kyXieOOw3eH User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.33 Safari/530.5,gzip(gfe),gzip(gfe) Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit