The thing is, you would want to have one main page, which loads (or includes) the others as needed.
Including the DynAPI source files only happens on the main page, so this page includes all the files needed for the others to run. It also has one onload function, within which the other files are loaded.
The other files are just the javascript that's usually within the onload function.
A setup would look something like this:
 
<html><head>
<script language="Javascript" src="../src/dynapi.js"></script>
<script language="Javascript">
 DynAPI.setLibraryPath('../src/lib/');
 DynAPI.include('dynapi.api.*');
 DynAPI.include('dynapi.event.*');
 DynAPI.include('dynapi.util.thread.js');
//Include all files needed for all pages here
 
</script></head>
<script language="Javascript">
 
DynAPI. {
 
    //Include file 1 here
 
    //include file 2 here
 
}
</script></html>
 
Hope that's what you mean.
 
Cheers,
Richard Bennett
 
[EMAIL PROTECTED]
www.richardinfo.com
(Everything running on, and ported to DynAPI2.53)
visit the DynAPI homepage (and FAQ) ::
http://dynapi.sourceforge.net/dynapi/index.php?menu=1
Browse (and search) the mailinglist here:
http://www.mail-archive.com/index.php3?hunt=dynapi
----- Original Message -----
Sent: 13 June, 2001 21:32
Subject: [Dynapi-Help] Re: How to call 2 DynAPI scripts from two templates

I have a dynamic web site that use an include command to switch different templates. So I have two scripts, one loaded in index.asp and the other in another template that sometime got called in by index.asp. What happen is I am using DynAPI. on both of them and I think that is why one overwrite the other? The scripts are below. Any idea on how to fix it? Thx.
 
//script 1 in index.asp. An object that slide in and out
---------------------------------------------------------------
<!--- <SCRIPT language="Javascript">

DynAPI. {
 
 objSpanel = new LoadPanel(); //ObjS panel
 objSpanel.setSize(170,350)
 objSpanel.moveTo(-155,129);
 objSpanel.setBgColor("#346767");
 objSpanel.setHTML('something here');
 objSpanel.do_slide=function() {
  if (objSpanel.x==-155) objSpanel.slideTo(0,129,10,20)
  else objSpanel.slideTo(-155,129,10,20)
 }
 
 DynAPI.document.addChild(objSpanel);
}
 
</script> --->
----------------------------------------------------------------
//script 2 in some body template. It's actually an inline table like iFrame with header and footer station and the body is scrollable.
----------------------------------------------------------------
<script language="Javascript">
DynAPI. {
 
 var layer1 = this.document.all['layer1']
 var layer2 = this.document.all['layer2']
 var layer3 = this.document.all['layer3']
 
 layer1.setSize(500,20)
 layer2.setSize(500,50) //has to be the same as the scrollpane.
 layer3.setSize(500,20)
 
 lp = new LoadPanel();
 lp.setSize(484,350); // height will be overwritten by default
 lp.setBgColor('#cccccc');
 lp.setHTML('Body Layer');
 
 scrollobj = new ScrollPane(lp);  // label1 will be set as the content
 scrollobj.setSize(500,50);
 scrollobj.setBgColor('#cccccc');
 
 tblHdrLyr = new DynLayer();
 tblHdrLyr.setSize(500,20);
 tblHdrLyr.setBgColor('#cccccc');
 tblHdrLyr.setHTML('Header Layer');
 
 tblFtrLyr = new DynLayer();
 tblFtrLyr.setSize(500,20);
 tblFtrLyr.setBgColor('#cccccc');
 tblFtrLyr.setHTML('Footer Layer');
 
 if(is.ns){
  DynAPI.document.addChild(scrollobj);
  DynAPI.document.addChild(tblHdrLyr);
  DynAPI.document.addChild(tblFtrLyr);
  if(is.ns4){
  scrollobj.moveTo(layer2.getPageX(),layer2.getPageY()-65);
  tblHdrLyr.moveTo(layer1.getPageX(),layer1.getPageY()-96);
  tblFtrLyr.moveTo(layer3.getPageX(),layer3.getPageY()+70);
  }
  else {
  scrollobj.moveTo(layer2.getPageX()+7,layer2.getPageY()-65);
  tblHdrLyr.moveTo(layer1.getPageX()+7,layer1.getPageY()-112);
  tblFtrLyr.moveTo(layer3.getPageX()+7,layer3.getPageY()+85);
  }
 } else {
 layer2.addChild(scrollobj);
 layer1.addChild(tblHdrLyr);
 layer3.addChild(tblFtrLyr);
 }
}
</script>

Reply via email to