problem with using refresh() on an Active.HTML.DIV?
I have the following scenario that is not doing what I would expect it to. I have decided to do all of my page generation through the use of Active.HTML objects. I create a page one, then via scripts from the server I alter portions of the page to display new information or change object properties. Here is some code that you can try and load and see if you get the same results. Basically, one the refresh() method is called, things go south. Any thoughts as to how I can change to code to get the desired results or is there a bug that there is a fix too?
Thanks
<html>
<head>
<SCRIPT type="Text/javascript" src="grid.js" ></SCRIPT>
<body style="padding:0;margin:0">
<script type="text/javascript">
div1 = new Active.HTML.DIV;
div1.setId("d1");
div1.setStyle("background-color", "blue");
div1.setStyle("position", "absolute");
div1.setStyle("width", 200);
div1.setStyle("height", 200);
document.write(div1);
// now lets assume other things happen here, over time, and then
// later we want to add a div to div1
// everything I do is on the fly and the page
// never gets 'refreshed' it just gets pieces of
// it changed via scripts
div2 = new Active.HTML.DIV;
div2.setId("d2");
div2.setStyle("width", 50);
div2.setStyle("height", 50);
div2.setStyle("position", "absolute");
div2.setStyle("background-color", "red");
div1.setContent("html", div2.toString()); // have also used just div2 but got the same results
// if there is a better, more correct way to
// add one Active object to another let me know
alert(div1); // you get the exact result you would expect to get
div1.refesh(); // to display the first DIV with it's new div inside
// note that it doesn't work
alert(div1); // note that this alert never happens, what happened to
// the script?
</script>
</body>
</html>
Thanks
<html>
<head>
<SCRIPT type="Text/javascript" src="grid.js" ></SCRIPT>
<body style="padding:0;margin:0">
<script type="text/javascript">
div1 = new Active.HTML.DIV;
div1.setId("d1");
div1.setStyle("background-color", "blue");
div1.setStyle("position", "absolute");
div1.setStyle("width", 200);
div1.setStyle("height", 200);
document.write(div1);
// now lets assume other things happen here, over time, and then
// later we want to add a div to div1
// everything I do is on the fly and the page
// never gets 'refreshed' it just gets pieces of
// it changed via scripts
div2 = new Active.HTML.DIV;
div2.setId("d2");
div2.setStyle("width", 50);
div2.setStyle("height", 50);
div2.setStyle("position", "absolute");
div2.setStyle("background-color", "red");
div1.setContent("html", div2.toString()); // have also used just div2 but got the same results
// if there is a better, more correct way to
// add one Active object to another let me know
alert(div1); // you get the exact result you would expect to get
div1.refesh(); // to display the first DIV with it's new div inside
// note that it doesn't work
alert(div1); // note that this alert never happens, what happened to
// the script?
</script>
</body>
</html>
Jim Hunter
November 16,