//Compatability
var m = window.addEventListener ? "addEventListener" : "attachEvent";
var ev = m == "attachEvent" ? "onmessage" : "message";
// On successful submission, you'll receive a message from the iframe
// You can handle the response below
// e.data will either be 'success' or 'failure'
window[m](ev, function (e) {
if (e.data.message === 'success') {
// Handle success (i.e. a redirect) here
// my agency’s code here;
// For example,
// window.location.replace(http://www.myAgency.org/ThanksforSubmittingPreApp.html);
} else {
// Handle failure here
// my agency’s code here;
}
}, false);