How to check type of ajax response

Hello,
When my post message is successfully saved I am returning simple
message via:

flash[:notice] = “OK”

and when there are some errors due to validation I return the message
in similar way:

flash[:notice] = form.errors.to_xml()

then the message is sent via ajax:

respond_to do |format|
format.html { redirect_to :back }
format.js

How can I check on the client side which message was sent before
displaying it?
I am using jQuery.
Thanks,
bogumbiker

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs