Besttoolbars Development network

Back to Besttoolbars main site

 

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
DocumentComplete(tool) function error

 
Post new topic   Reply to topic    BestToolbars.Net Forum Index -> General questions
Author Message
Apostrophe



Joined: 30 Aug 2006
Posts: 1

PostPosted: Fri Sep 01, 2006 12:11 am    Post subject: DocumentComplete(tool) function error Reply with quote

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

PostPosted: Tue Sep 05, 2006 5:48 pm    Post subject: Reply with quote

Try to use MainWindow.document.appendChild instead of MainWindow.document.body.insertBefore.
Back to top
Admin
Site Admin


Joined: 22 Aug 2006
Posts: 1055

PostPosted: Wed Sep 06, 2006 9:15 am    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BestToolbars.Net Forum Index -> General questions All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group

Copyright c Softomate, 2010. All Rights Reserved
Terms of Service | Privacy Policy