[Project_owners] sidebar content

Wladimir Palant trev at gtchat.de
Mon Sep 27 14:50:17 EDT 2004


Attila Szabo wrote:

> In my sidebar I have a textbox, and from the main window's javascript I 
> unable to get the textbox, by getElementById.

That's because the sidebar content is inside a browser element, you have 
to find it first and try its contentDocument then. Finding the current 
sidebar in Mozilla is somewhat tricky:

window.sidebarObj.panels
       .get_panel_from_id(window.SidebarGetLastSelectedPanel())
       .get_iframe()
       .contentDocument
       .getElementById('mid:searchWord');

Same thing for Firefox is somewhat simpler:

document.getElementById('sidebar')
	.contentDocument
	.getElementById('mid:searchWord');


Wladimir


More information about the Project_owners mailing list