I have a button on a page which when clicked makes a ajax request. Viewing the response in firebug and looking at the page it basically returns the exact same page in the browser with the addition of an image and some text wrapped in a table. How would I check this response and see if it contains this text and image and if it find it redirect to another page.
The redirect I pretty much have
location.replace('http://www.redirectpage.com');
But I do not know how to target and check the response.
I want to so something like this in either Jquery or javascript.
If response has text contains "Please fill in" and contains /a/a/i/error_alert.gif then redirect to
http://www.redirectpage.com
Sorry for my noobness, any help would be appreciated!!!