Hi, what im wanting to achieve is if a error appears ( one which I have come up with ) and contains the word 'error' then the function stops in its tracks. What the function basically consists of is 5 ajax requests, when one is successful the other kicks in.. like so..
function thing() {
$.ajax({
...
...
success:
function(html){
errorGet(html);
$.ajax({
...
...
success:
function(html){
errorGet(html);
...
...
I have a function in place 'errorGet()' to try and stop the function;
function errorGet(data){
var re = /error/mgi;
if( data.search( re ) == 0 ){
thing.stop;
}
}
but i know thing.stop doen't work but does anyone know how to stop the process?