title: Perform action after if statement CasperJS
body: <p>I had a problem with checking continuously page for change of attribute but I did it.
  Now my main code looks like this:</p>
  
  <pre><code>casper.thenOpen('pageurl', function() { 
      this.then(function () {
          function checkReload()
          {
              var cur = this.getElementAttribute("classname", "attr");
              if (cur == "target") {here
                  return; // finished
              }
              else
              {
                  this.echo(cur);
              }
              this.reload();
              this.wait(1, checkReload); // check again in a second
          }
          this.then(checkReload);         
      }).thenEvaluate(function(){
          this.click("#new_add");
          this.echo("done567");   
          this.then.waitForSelector(".cartGdList",
              function pass () {
                  this.click("...");
                  this.echo("done8");
                  this.then(function () {
                      this.waitForSelector(".cart_s_Box",
                          function pass () {
                              this.click("#js_upFormBtn");
                              this.echo("step4");
                              var end = new Date().getTime();
                              var time = end - start;
                              this.echo('time: ' + time + 'ms*');
                          },
                          function fail () {
                              this.echo('fail');
                          }
                      );
                  });
              },
              function fail () {
                  this.echo('fail');
              }
          );
      });
  });
  </code></pre>
  
  <p>And after if statement would be OK <code>if(cur == "target")</code>
  I want to perform this code:</p>
  
  <pre><code>this.click("#new_add");
  this.echo("done567");   
  this.then.waitForSelector(".cartGdList",
      function pass () {
          this.click("...");
          this.echo("done8");
          this.then(function () {
              this.waitForSelector(".cart_s_Box",
                  function pass () {
                      this.click("#js_upFormBtn");
                      this.echo("step4");
                      var end = new Date().getTime();
                      var time = end - start;
                      this.echo('time: ' + time + 'ms*');
                  },
                  function fail () {
                      this.echo('fail');
                  }
              );
          });
      },
      function fail () {
          this.echo('fail');
      }
  );
  </code></pre>
  
  <p>How can I do this, I tried to put this on <code>thenEvaluate</code> but this doesn't work.</p>