![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 4 298 Pomógł: 447 Dołączył: 16.11.2006 Ostrzeżenie: (0%) ![]() ![]() |
Napisałem prosty edytor iframe (designmode itd)... chciałbym zrobić podgląd źródła, dlatego napisałem tak:
Kod i = document.getElementById('iframe'); t = document.getElementById('textarea'); t.innerText = i.contentWindow.document.body.innerHTML; /* IE, Opera */ t.textContent = i.contentWindow.document.body.innerHTML; /* Fx, Safari */ Tym sposobem wysyłam z iframe do textarea całą zawartość, działa prawidłowo, jednak problem zaczyna się przy edycji kodu, w drugą stronę: Kod i.contentWindow.document.body.innerHTML = t.innerText; /* IE, Opera */ i.contentWindow.document.body.innerHTML = t.textContent; /* Fx, Safari */ Działa ten efekt na IE i Operze, jednak na Fx czy Safari już nie, dlaczego? przy wysyłaniu z textera do iframe trzeba użyć czegoś innego niż textContent ? |
|
|
![]()
Post
#2
|
|
Grupa: Moderatorzy Postów: 36 557 Pomógł: 6315 Dołączył: 27.12.2004 ![]() |
.value
(IMG:style_emoticons/default/smile.gif) |
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 4 298 Pomógł: 447 Dołączył: 16.11.2006 Ostrzeżenie: (0%) ![]() ![]() |
Hehe kurde fakt (IMG:style_emoticons/default/biggrin.gif)
|
|
|
![]() ![]() |
![]() |
Aktualny czas: 23.08.2025 - 02:21 |