5
Javascript that is added dynamically to a page needs to be eval-d in order to correctly initialise.
In order for that to work correctly for function definitions they need to be formatted slightly differently. eg:
<script>
newfunc = function()
{
alert("here");
}
</script>
<button type="button" o...