For example:
In the HTML page
xmlHttpObj.open("GET", "url.php", true);
xmlHttpObj.onreadystatechange = function(){
..
document.getElementById('divInThisPage').innerHTML = xmlHttpObj.responseText;
..
}
..
..
function foo(arg){
alert(arg);
}
In the url.php
echo "<input type='button' value='ok' onclick=\"foo('ok')\" />";
The question is, why the alert won't work?
edit: even if in the url.php I put a inline javascript code the button still doesn't work
echo "<input type='button' value='ok' onclick=\"alert('ok')\" />";
inputelement get put into the document? If so, does your browser display a JS error when you click on it?