Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> table.innerHTML i IE
ActivePlayer
post
Post #1





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

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


js onclick na jakimstam linku:
Kod
var tabelka = document.getElementById('plan');
//...
tabelka.innerHTML = tabelka.innerHTML + do_dodania;  // w tym miejscu IE sie wysypuje
// do_dodania jest stringiem i zawiera dobre dane

  1. <table id="plan">
  2. ...


pod ff smiga. pod IE nie bardzo (IMG:http://forum.php.pl/style_emoticons/default/sad.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
bregovic
post
Post #2





Grupa: Zarejestrowani
Postów: 562
Pomógł: 15
Dołączył: 8.08.2003
Skąd: Denmark/Odense

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


Teoretycznie używanie innerHTML w ten sposób to błąd. Aby było to poprawne użycie DOM powinieneś stworzyć nowe gałęzie i dodać je do table.

Coś w stylu:
Kod
div = document.createElement("div");
preface = document.getElementById("preface");
document.insertBefore(div, preface);

Ale to może być moja pedantyczność.

Parę linków:
http://developer.mozilla.org/en/docs/DOM
http://developer.mozilla.org/en/docs/Gecko_DOM_Reference

Ten post edytował bregovic 7.11.2005, 15:55:06
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: 8.10.2025 - 01:54