keenanstahl
01-29-2009, 09:07 PM
My AJAX call places the following HTML into the innerHTML of a <DIV>. The problem is the javascript within it doesn't work. If I manually code the same HTML into a DIV it works.
<html>
<body>
<SCRIPT language=JavaScript>
function pMenu()
{
alert("duh");
}
</SCRIPT>
<DIV id=pMenuDiv onmouseover=pMenu()>The Div</DIV>
</body>
</html>
By populating innerHTML, I don't think the DOM knows this script exists. How do I make it exist? I believe other posts have dealt with this issue but the solution is wrapped in other "canned" scripts that I'm struggling to understand......
<html>
<body>
<SCRIPT language=JavaScript>
function pMenu()
{
alert("duh");
}
</SCRIPT>
<DIV id=pMenuDiv onmouseover=pMenu()>The Div</DIV>
</body>
</html>
By populating innerHTML, I don't think the DOM knows this script exists. How do I make it exist? I believe other posts have dealt with this issue but the solution is wrapped in other "canned" scripts that I'm struggling to understand......