Assuming you're calling the method via Ajax dataType html, you can get the return html which will be the entire CP html include the message, e.g.:
function submitForm($form) {
//### Send form via AJAX ###
$.ajax({
type: "POST",
data: $form.serialize(),
dataType: "html",
url: $form.attr("action"),
cache: false,
success: function (html) {
$("#footer").after(getMessage(html));
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
//### Error occurred, could be server, CMS or 404 ###
$form.find("[type='submit']").fadeTo("slow", 1).removeAttr("disabled").removeClass("disabled")
.addClass('error')
.after('<label class="error" generated="true">'+textStatus+'</label>');
}
});
} //### End of submitForm function ###
This could probably be simplified to:
$(this).click( function(e) {
var url = $(this.form).attr('action');
var data = $(this.form).serialize();
$.post(url, data, function() {
$("#footer").after(getMessage(html));
});
e.preventDefault();
});
In the EE Admin the #notice_container div contains the message(s) and appears after the #footer div in the DOM.
Handy JQuery function to get the div and content (as opposed to just innerHTML):
jQuery.fn.outerHTML = function() {
return jQuery('<div />').append(this.eq(0).clone()).html();
};
Source: https://stackoverflow.com/questions/3614212/jquery-get-html-of-a-whole-element
Then you'll need the code to rip the message from the return html:
function getMessage(html_string) {
var $html = $('<div>',{html:html_string}).hide().appendTo('body');
$message_div = $html.find('#notice_container').outerHTML();
$html.remove();
return $message_div;
}
Hopefully this should then place the message and message html elements into your page - the next problem is it's probably hidden via CSS, if so, show it via JS.
And finally there's no JS code attached to it. So have a scan of the Control Panel code looking for triggers on #notice_counts, .notice_success, .notice_alert, .notice_error & .notice_info and either re-intialise or duplicate the functionality (open and close slider - the remove is in-line JS so no need to worry).
All the above is theory, so not tested but will hopefully help!