Hello,
Please help and explain the following:

myLayer.setHTML('click here <script>function test(){alert("clicked1");}
document.onclick=test;</' + 'script>');

The above work in NS4.08 when you click within the layer area, but does
not in IE5.5 (even if you click outside of the area).

I then verified by manually writing the inline as:

<div>click here
        <script>
                function test(){ alert("clicked2"); }
                document.onclick = test;
        </script>
</div>

The above work in both NS and  IE when you click anywhere in the
document.

Basically, what I want to do is to create a layer then able to set(as
often as I like) its content, along with javascript to manuplate it, by
using setHTML() that would work for both NS and IE. I don't care if it
support Localizing(as in NS) or Globalizing (as in IE).

Is it possible?

Thanks,
Thanh Truong



FULL SOURCE:
<html>
<head><title>Creating a Dynlayer</title>
<script language="JavaScript" src="../dynapi/src/dynapi.js"></script>
<script language="javascript">
DynAPI.setLibraryPath('../dynapi/src/lib/');
DynAPI.include("dynapi.api.*"); // include all dynapi/api/ files
DynAPI.onLoad = function() { // create dynlayer after page is loaded

   var myLayer = new DynLayer(); // make DynLayer object
   myLayer.setSize(200, 100); // set its size (width, height)
   myLayer.setBgColor("#c0c0c0"); // set its color
   myLayer.moveTo(150, 100); // set its position (x, y)

   DynAPI.document.addChild(myLayer); // and add it to the document
   //
   myLayer.setHTML('click here <script>function
test(){alert("clicked1");} document.onclick=test;</' + 'script>');
}
</script>
</head>
<body>

<h1>Creating a Dynlayer</h1>
<div>click here
        <script>
                function ii(){ alert("clicked2"); }
                document.onclick = ii;
        </script>
</div>
</body>
<script>
</script>
</html>
 




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

Reply via email to