In my main file where the HTML/JS below is being posted beteween DIV TAGS, there is a script to run the JS after the xmlhttprequest. In the JS below there is a line that needs to access the innerHTML of the element "lg1". However, this will not display on the page. Any ideas?
SHOP.HTML
[HTML]<body>
<link rel="stylesheet " type="text/css" href="screen.cs s" />
<script type="text/javascript">
var s = document.create Element('script ');
s.src = 'yahoo.js';
document.body.a ppendChild(s);
...<execute a few more scripts>
</script>
</body>
<script type="text/javascript">
YAHOO.example.D DApp = function() {
return {
init: function() {
var eul = document.getEle mentById("lg1") ;
var eli = document.create Element("li");
// eli.appendChild (document.creat eTextNode("WSJ. com"));
eli.innerHTML = "<image src='barrons.jp g' />";
eli.id = "test";
eli.setAttribut e("class", "sortList") ;
eli.setAttribut e("className" , "sortList") ;
eli.price = 19.99
eul.appendChild (eli);
new YAHOO.example.D DList("test");
new YAHOO.example.D DListBoundary(" hidden1");
new YAHOO.example.D DListBoundary(" hidden2");
new YAHOO.example.D DListBoundary(" hidden3");
}
};
} ();
YAHOO.util.DDM. mode = YAHOO.util.DDM. INTERSECT; //Sets the mode to Intersect which provides more freedom when dragging and dropping on a target
YAHOO.util.Even t.addListener(w indow, "load", YAHOO.example.D DApp.init);
</script>
<div id="update">
<td>
<ul id="lg1" class="listGrou p1">Products
...
</ul>
</td>
...
</div>
[/HTML]
hi ...
please give an example on what you are doing ...
you are writing text to a div and this text contains js ... right? now you parse that text and eval the js ... right? the evaled js uses the same text where it is in? ... perhaps you simplify your code and post an example here ... so that we may have a closer look on it.
kind regards ...