contents : [
{
id : 'plugin_name',
label : editor.lang.plugin_name.dialogTitle,
elements :
[
{
type : 'html',
html : '<div id="results">' + getValidationResult(editor.getData()) + '</div>' // The returned value in getValidationResult is not returned here, the html content in the dialog box is '<div id="result">undefined</div>'
}
]
}
]
function getValidationResult(data) {
var httpRequest = (!window.XMLHttpRequest)? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
var passingData = "action=analize&content="+escape(data);
httpRequest.open("POST", "url.jsp", true);
httpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
httpRequest.setRequestHeader("Content-length", passingData.length);
httpRequest.setRequestHeader("Connection", "close");
httpRequest.onreadystatechange = function()
{
if(httpRequest.readyState == 4)
{
var result = httpRequest.responseText;
// Here, the result variable has the ajax response html
return result;
}
}
httpRequest.send(passingData);
}
Edited:

OnLoad
Have you tried modifying the html on the OnLoad event?