How does one access Javascript variables in the LoadPanel? I am confused
as to what I should be looking for. I found a way to do it in Netscape
(see example below), but I don't know why it works. In the example, I
don't use setURL, just setHTML, so I guess the question does not depend
on LoadPanel - it could just as easily be a DynLayer object. Is there a
method that I am missing?

<<<<<<<<<<<<<<<<<<<EXAMPLE>>>>>>>>>>>>>>>>>>
<HTML><HEAD>
<!-- will have to change for your environment -->
<script language="Javascript" src="/dynapi/dynapi.js"></script>
<script language="Javascript">
DynAPI.setLibraryPath('');
DynAPI.include('dynapi.api.*');
DynAPI.include('dynapi.gui.loadpanel.js');
</script>

<script language="Javascript">
DynAPI.onLoad=function() {
        $go_dynobj = new LoadPanel();
        $go_dynobj.setHTML("no file loaded");

        $go_dynobj.setSize(250,50); // height will be overwritten by
default
        $go_dynobj.moveTo(100,100);
        $go_dynobj.setBgColor('yellow');

        counter = 0;
        var el = new EventListener($go_dynobj);
        el.onload = function(e) {
                status = 'got load event '+ counter++;
                var $targ = e.getTarget();
                alert("testvar:" + $targ.elm.$testvar); //This works for
Netscape. Why?
        }
        $go_dynobj.addEventListener(el);

        DynAPI.document.addChild($go_dynobj);

   return;
}

function go( )
{
 var $s = '<html><head><script language="javascript">var
$testvar="OK";\x3C/script>'
  + '</head><body >'
  + 'HERE I AM'
  + '</body></html>';

 $go_dynobj.setHTML($s);
   return;
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white" >
<a href="javascript:go()">Load Panel</a>
</BODY>
</HTML>
<<<<<<<<<<<<<<<<<<END OF EXAMPLE>>>>>>>>>>>>>>>>>>

--
Al Byers
Local Square, Inc.
826 N. Augusta St.
Staunton, VA 24401
540.213.0500
www.localsquare.com
[EMAIL PROTECTED]



_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to