Cameron, I really appreciate your reply, but I am afraid that I am not
quite able to grasp what you are saying. If you will give me a few more
clues, then I will try to write it up as an example that could be
included in future documentation.
How would I redo this code for IE?
...
var $targ = e.getTarget();
alert("testvar:" + $targ.elm.$testvar);
...
Do I need to put "var $testvar = 'OK';" in the body of the HTML?
Do you think we need a single API to access variables in LoadPanel?
I will try to further identify my points of confusion in the comments
below, but an example would be worth a great deal.
Thanks for your help and your patience.
-Al
Cameron Hart wrote:
> I don't know about using sethtml...
Are you saying that using setHTML might not be doing the same thing as
what happens on the response from setURL? What can I look at to tell?
> if you are loading
> something into a loadpanel in IE it
did you mean to put "ignores" here?
> everything except
> the innerHTML of the body tag (so style info in the
> head, bgcolor on the body etc). it also ignores any
> inline scripts and styles. the only scripts that get
> executed are events,
The only event I am interested in is "onload", since this is a hidden
element.
> so onclicks still work inside the
> loadpanel. netscape on the other hand will let you
> include scripts and css files etc.
>
> --- Al Byers <[EMAIL PROTECTED]> wrote: > 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
> >
> >
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dynapi-help
--
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