You use DOM scripting for that. Something like
Code:
<script language="javascript">
foo = function() {
var message = document.createTextNode('Hello World');
var b = document.createElement('b');
b.appendChild(message);
document.getElementById('hello').appendChild(b);
};
</script>
<body onLoad="foo()">
<div id="hello"></div>
</body>
Which results in a page that looks like
Code:
<body>
<div><b>Hello World</b></div>
</body>
This is of course a pretty stupid way of doing that, but the point is that it works just as well from any javascript function -- including the handlers of AJAX responses.
Just google DOM Scripting in Javascript and you'll find tons of resources.
Bookmarks