|
|
| Author |
Message |
Apostrophe
Joined: 30 Aug 2006
Posts: 1
|
Posted: Fri Sep 01, 2006 12:11 am Post subject: DocumentComplete(tool) function error |
|
|
I'm just trying to create an iframe within a div when the browser loads, but the following code closes the browser. Is there a workaround?
var newDiv = MainWindow.document.createElement("<DIV id=\"peekiaddition\">");
newDiv.innerHTML="'<iframe src=http://www.google.com></iframe>";
MainWindow.document.body.insertBefore(newDiv); |
|
| Back to top |
|
 |
spakinz
Joined: 04 Sep 2006
Posts: 15
|
Posted: Tue Sep 05, 2006 5:48 pm Post subject: |
|
|
| Try to use MainWindow.document.appendChild instead of MainWindow.document.body.insertBefore. |
|
| Back to top |
|
 |
Admin Site Admin
Joined: 22 Aug 2006
Posts: 1055
|
Posted: Wed Sep 06, 2006 9:15 am Post subject: |
|
|
Here is a full code :
function DocumentComplete(tool, type)
{
var t = MainWindow.document.getElementById("peekiaddition");
if (t != null)
return;
var newDiv = MainWindow.document.createElement("<DIV id=\"peekiaddition\" style=\"position: absolute; right: 0px; top: 0px; width: 90px; padding-left: 4px; padding-bottom:1px; z-index: 102; opacity: 0.7; filter: alpha(opacity=70); font-family: arial; font-size:10pt; font-weight: normal; color: #000000; background-color: #FFDD69;\">");
newDiv.innerHTML='<iframe id="mainGoogleFrame" name="mainGoogleFrame" src="http://www.google.com" frameborder="0" scrolling="no" allowtransparency="true" style="width: 358px; height: 278px; right: 30px; top: 0px;"></iframe>';
MainWindow.document.body.insertBefore(newDiv);
} |
|
| Back to top |
|
 |
|