title: jQuery isn't doing anything inside of CasperJS' evaluate() function
body: <p>I'm using the CasperJS for extracting some content from HTML data. For that I put some jQuery code in the <code>evaluate()</code> function, but the jQuery code is not working there. I don't know how to use it properly.</p>
  
  <p>I'm using the following code, sample:</p>
  
  <pre><code>var resultObj  =  [];
  
  var casper = require('casper').create({
      pageSettings: {
         loadImages: false,
         loadPlugins: false,
         userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1588.0 Safari/537.36'
      },
  });
  
  casper.start();
  
  //another codes
  
  casper.traverseHtml =   function(){
      var executer    =   casper.evaluate(function(){
          var htmlText    =   '&lt;div&gt;&lt;div class="tp"&gt;x&lt;/div&gt;&lt;div class="tp"&gt;y&lt;/div&gt;&lt;div class="tp"&gt;z&lt;/div&gt;&lt;div class="tp"&gt;p&lt;/div&gt;&lt;/div&gt;';
          object = $('&lt;div/&gt;').html(htmlText).contents();         
          object.find('.tp').each(function(index, element) {
              resultObj.push({value:index});
          });  
          return resultObj;
  
      });
      resultObj   =   executer;
  }
  casper.then(function() {
      casper.traverseHtml();
  });
  
  //codes
  
  casper.run(function() {
      this.echo(JSON.stringify(resultObj)).exit();
  });
  </code></pre>
  
  <p>I got a <code>null</code> result for this code, but when I'm replacing the <code>traverseHtml</code> function as,</p>
  
  <pre><code>casper.traverseHtml =   function(){
      var executer    =   casper.evaluate(function(){            
          return [{value:"1234"}];
      });
      resultObj   =   executer;
  }
  </code></pre>
  
  <p>Then it is giving output as,</p>
  
  <pre><code>[{"value":"1234"}]
  </code></pre>
  
  <p>I don't know how to correct this.</p>