Looking at your code I believe it passing the html code to the div.
I have done the exact same thing with AJAX. It shows on a web page nicely.
However I need to manipulate the data that is returned from the AJAX so I can do more with it. My problem is that I can not seem to find the correct way to pass the php script response via Ajax into a variable so I can work on it.
In my script, I'm not manipulating data in the browser. I'm only manipulating the DOM.
I'm using PHP to create a "result" and sending "jQuery" commmands back to the browser via Ajax. jQuery then runs the commands in "$code" to place the the colored boxes in the box.
As i stated, there are other options on the jQuery site if you would rather manipulate the data server side. If this is the case, you may want to explore the "JSON" dataType. My example uses the "script" dataType so I can do the majority of the work on the server and then just manipulate the DOM afterwards
in any event your code does not appear to work. perhaps you could post a description of what is suppose to happen.
I am NOT that versed on what DOM is. Looking back at my original post I still have not seen an example of manipulating what is sent back from the PHP script.