[Jslib] Re: Off Topic - Communcation between Sidebar and Window

Paul Kramer qbal@pacbell.net
Mon, 18 Mar 2002 16:18:18 -0800


I've been able to accomplish what I ask below in the  following manner

In my sidbars application, which is an html file that contains some
javascript functionality that I want the page I'm on in the browser
window to obtain

--- sidebar_foo.html ---
function insertFoo(x) {
   window._content.document.body.innerHTML = x;
}

function loadFoo() {
   window._content.foobar = insertFoo;
}

<a href="javascript:loadFoo();">Load App</a>

--- http://qbal/stuff.html ----
<a href="javascript:foobar('snafu');">Testing</a>

I'd love to here your opinions on this approach and if you suggest
other approaches

I have a snapshot of my development effort up on www.qbal.com
if you are interested.

Thanks
Kramer

Paul Kramer wrote:

> Hi Guys,
>
> This is off topic, but you guys are very good a pointing me in the right
> direction.
>
> I have a sidebar panel that will load some javascript variables and
> functions.
> The user will select a link that will load an html page in
> window._content
> which has javascript in it too.
>
> Basically what I want to do, is load up all the global vars and
> functions in
> the sidebar app and access from the sidebars vars/funcs in the newly
> loaded window in the main window
> or tabbed window....
>
> Any examples and/or pointing me in the direction of docs is greatly
> appreciated.
>
> Thanks,
> Kramer