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 */
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 */
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 ?