I am developing a personalised homepage system that loads in modules using AJAX.

Basically innerHTML is used to insert the returned AJAX data into a DIV for a module.

However if the module contents contains javascript, it is not executed - nothing happens.

So, in this basic example -
HTML Code:
<script language="javascript" type="text/javascript">
alert("test");
</script>
- why is alert("test") is not called? Is there anything I can do to cause this javascript content to be executed when the AJAX call is complete?

Thanks in advance.