Talk:CSS Independent Content: Difference between revisions
sometimes its blank |
How about this instead? |
||
Line 11: | Line 11: | ||
Isn't there a "domIsNowCreatedAndYouCanGoAhead" event that we can listen to instead of using setTimeout? | Isn't there a "domIsNowCreatedAndYouCanGoAhead" event that we can listen to instead of using setTimeout? | ||
== How about this instead? == | |||
function $(id) {return document.getElementById(id)}; | |||
var iframe = document.createElement("iframe"); | |||
iframe.setAttribute("id", "settings"); | |||
iframe.setAttribute("style", "display:block;z-index:1002;position:fixed;overflow:auto;left:30px;top:30px;right:30px;bottom:30px;background-color:white;padding:15px;border:1px solid black"); | |||
iframe.addEventListener('load', showSettings2, false); | |||
function showSettings2() { | |||
$('LIU_settings').contentDocument.body.innerHTML = '<html><body>test</body></html>'; | |||
} |
Revision as of 19:10, 5 June 2007
This might be more suitable in Code snippets?
- I agree. --Henrik 05:47, 5 June 2007 (EDT)
sometimes its blank
Hi, I have a problem with this. It could be that I do something wrong. However: about 1 out of 5 times the content stays blank. I tried to change the timeout to 1000. I tested it 20 times, and it worked all the time.
Isn't there a "domIsNowCreatedAndYouCanGoAhead" event that we can listen to instead of using setTimeout?
How about this instead?
function $(id) {return document.getElementById(id)};
var iframe = document.createElement("iframe"); iframe.setAttribute("id", "settings"); iframe.setAttribute("style", "display:block;z-index:1002;position:fixed;overflow:auto;left:30px;top:30px;right:30px;bottom:30px;background-color:white;padding:15px;border:1px solid black"); iframe.addEventListener('load', showSettings2, false);
function showSettings2() {
$('LIU_settings').contentDocument.body.innerHTML = '<html><body>test</body></html>';
}