Created
October 25, 2010 09:05
-
-
Save bogdan/644648 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('html').ajaxSuccess(function(event,request,options) { | |
var data = null; | |
try { | |
data = $.parseJSON(request.responseText); | |
} catch(e) { | |
// well... this is hacky and we're parsing all incoming ajax responses. i'd really like to do this in a nicer way | |
} | |
if ((data!==null) && (data.flash!==null)) { | |
$.each(data.flash, function(k,v) { | |
$.flash(v, {type: k}); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment