I have copied this example in CasperJS.
How would I implement a 'continue' command in combination?
casper.then(function() {
var current = 1;
var end = 4;
var something = true;
for (;current < end;) {
(function(cntr) {
casper.thenOpen('about:blank', function() {
this.echo('loop number: '+ cntr);
});
casper.then(function(){
if (something) {
continue; // ERROR: 'continue' is only valid inside a loop statement
}
});
casper.then(function(){
this.echo('this still gets printed');
});
})(current);
current++;
}
});
I'm getting a 'only valid inside a loop' error but... it is inside a loop?