I need to show status messages (the kind typically shown by drupal_set_message()
) in my module's JavaScript code. How can I do this reliably, such that the theme and placement of the messages remains consistent with the way drupal_set_message()
does it?
I'm looking for a solution that accounts for the presence or absence of prior messages on the page, and that works for any theme.
Pointing to existing modules that perform this would be great!
'mymodule/message'
which, given a message and a type, callsdrupal_set_message()
and then returns to the caller the output oftheme('status_messages')
. * On the JavaScript side, invoke this callback via$("#messages").load('mymodule/message')