I finally solved the problem by refining Björn's answer a bit. His approach was to use a content div inside the infowindow and update it with document.getElementById()
once the AJAX response arrives. This works, but doesn't resize the infowindow to fit the AJAX content ==> the "bubble" is overflowed.
My final solution solves this by calculating the dimensions of the content div once the AJAX content was stuffed in. Then I use the infoWindow.reset()-Method to specifiy the new dimensions.
This was a bit quirky in the beginning, but finally it turned out that .reset() also needs the marker position to render the resized infowindow correctly. Note that I'm using jQuery for the DOM stuff.
marker = new GMarker (...);
GEvent.addListener(marker,'click', loadPOIDescription);
function loadPOIDescription (){
var marker = this;
marker.openInfoWindow('<div id="marker-info">Loading POI Description...</div>');
$.get("backend.php", function(data){
var $contentDiv = $("#marker-info");
$contentDiv.html(data);
//the magic happens here
var position = marker.getLatLng();
var infoWindow = map.getInfoWindow(); //map is my global GMaps2 object
// set the infowindow size to the dimensions of the content div
var infoWindowSize = new GSize($contentDiv.width(), $contentDiv.height());
//apply the modifications
infoWindow.reset(position, null, infoWindowSize, null, null); //reset the infowindow
});
}