Hi.  Thanks for your help so far.  I took Joe's code, pasted it into a text file, and 
ran the example but no layer shows up in IE or Netscape.  IE does not give an exact 
error but Netscape says:
dyndoc.doc.window has no properties.
If I click on the change color link I get the following error: layer1 is undefined.  

I have looked at everyone's helpful posts and I can see that the dynapi is very 
powerful and will be useful for many of my projects.  For this project, I would like 
to manipulate a div using the dynapi.  Could someone post an example of how to modify 
a div using the dynapi in an href?  I was hoping to see how an inlne div that has been 
turned into a dynlayer (by using the this.document.all['layername'] syntax) could be 
manipulated by javascript inside an href.  Could anyone help with this?  Thanks very 
much for all your help with this.

Greg



-----Original Message-----
From:    Jon McLennan [EMAIL PROTECTED]
Sent:    Fri, 2 Feb 2001 14:24:03 -0800
To:      [EMAIL PROTECTED]
Subject: RE: [Dynapi-Help] question for new user


using layer1 as the inline div's id is confusing to the browser. call it
layer1Div.
 
Here's the way it should look
 
Jon
 
<html>
<head>
<title>DynAPI Distribution: Inline Layers Example</title>
 
<script language="JavaScript" src="./src/dynapi.js"></script>
<script language="Javascript">
DynAPI.setLibraryPath('./src/lib/')
DynAPI.include('dynapi.api.*')
DynAPI.include('dynapi.ext.inline.js')
</script>
<script language="Javascript">
 
DynAPI.onLoad=function() {
 layer1 = this.document.all['layer1Div']    // NOTE THE REMOVED 'var' and
the name of the layer being changed to 'layer1Div'
 layer1.moveTo(100,100)
 layer1.setBgColor('#F8F8F8')
 layer1.setVisible(true)
 
 var myevent1 = new EventListener(this.document)
 myevent1.onmouseup = function(e) {
  alert('Click')
 }
 layer1.addEventListener(myevent1)
}
 
</script>
</head>
 
<body>
<div id="layer1Div" style="position:absolute; visibility:hidden">This is a
test</div>
<!-- ******** how can I get this href to work ***************-->
<a href="javascript:layer1.setBgColor('red')">Change Color</a>
 
</body>
</html>


-----Original Message-----
From: Greg Jacobson [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 02, 2001 2:17 PM
To: [EMAIL PROTECTED]
Subject: [Dynapi-Help] question for new user


Hi. I have been trying to use the DynApi today to implement a scrollable
window.  I have a lot of dynamic text that comes from a database and may
contain a lot of quotes. so as far as I  understand this rules out creating
a layer using the .setText method.  I have been trying to use inline method
but have not been successful.  Below is a simple, slightly modified example
form the code examples on the dynapi site.  Could someone please tell me how
to make this work?  The error I get is Line: 0 Object does not support this
property or method.
 
Also, it seems that you cannot have an onLoad() in the body tag of an html
page when using the dynapi. Is this correct?  Thanks very much for any help.
 
 
Greg
 
 
<html>
<head>
<title>DynAPI Distribution: Inline Layers Example</title>
 
<script language="JavaScript" src="./src/dynapi.js"></script>
<script language="Javascript">
DynAPI.setLibraryPath('./src/lib/')
DynAPI.include('dynapi.api.*')
DynAPI.include('dynapi.ext.inline.js')
</script>
<script language="Javascript">
 
DynAPI.onLoad=function() {
 var layer1 = this.document.all['layer1'] 
 layer1.moveTo(100,100)
 layer1.setBgColor('#F8F8F8')
 layer1.setVisible(true)
 
 var myevent1 = new EventListener(this.document)
 myevent1.onmouseup = function(e) {
  alert('Click')
 }
 layer1.addEventListener(myevent1)
}
 
</script>
</head>
 
<body>
<div id="layer1" style="position:absolute; visibility:hidden">This is a
test</div>
<!-- ******** how can I get this href to work ***************-->
<a href="javascript:layer1.setBgColor('red')">Change Color</a>
 
</body>
</html>





___________________________________________________________________________
Visit http://www.visto.com/info, your free web-based communications center.
Visto.com. Life on the Dot.


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

Reply via email to