Safari (Mac) + innerHTML
-
Hi everyone! I have a html page with an IFrame; and the following code:
var doc = document.getElementById("iframe_id").contentDocument;
doc.body.innerHTML = htmlCode;This code is run in body's onload handler. 'htmlCode' contains some (very simple) html (it is a string, of course). I was able to test this code only in Safari 1.3 (Mac), and it didn't work :( BUT: I need to test it in a Safari 2.0.4. Unfortunatelly, I don't have access to it. Anyone (with Mac) can tell me if it will work? And why the above code didn't work with Safari 1.3? Is it possible to fix it? Thank you very much in advance! P.S. I understand it is a MS-centric forum, but... I do hope.
------------------------- Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
-
Hi everyone! I have a html page with an IFrame; and the following code:
var doc = document.getElementById("iframe_id").contentDocument;
doc.body.innerHTML = htmlCode;This code is run in body's onload handler. 'htmlCode' contains some (very simple) html (it is a string, of course). I was able to test this code only in Safari 1.3 (Mac), and it didn't work :( BUT: I need to test it in a Safari 2.0.4. Unfortunatelly, I don't have access to it. Anyone (with Mac) can tell me if it will work? And why the above code didn't work with Safari 1.3? Is it possible to fix it? Thank you very much in advance! P.S. I understand it is a MS-centric forum, but... I do hope.
------------------------- Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
You might have better luck with writing the entire page into the iframe. Example:
var doc = document.getElementById("iframe_id").contentDocument;
doc.open();
doc.write('<html><head><title></title></head><body>'+htmlCode+'</body></html>');
doc.close();--- single minded; short sighted; long gone;
-
You might have better luck with writing the entire page into the iframe. Example:
var doc = document.getElementById("iframe_id").contentDocument;
doc.open();
doc.write('<html><head><title></title></head><body>'+htmlCode+'</body></html>');
doc.close();--- single minded; short sighted; long gone;
Ok, this variant does work :) But what to do with the original code? Does it work in the Safari 2?... Thanks anyway.
------------------------- Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
-
Ok, this variant does work :) But what to do with the original code? Does it work in the Safari 2?... Thanks anyway.
------------------------- Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
-
Ok, this variant does work :) But what to do with the original code? Does it work in the Safari 2?... Thanks anyway.
------------------------- Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).