How do I set a variable from casper.evaluate()?
问题 I'm trying to set a value from within casper.evaluate() that I will check later to run a test on, but it doesn't seem to be working. isArticleOrReview = false; casper.waitFor(function check() { //here I'm just waiting for jQuery to load return this.evaluate(function() { return jQuery.fn.jquery == '1.2.6'; }); }, function then() { //once jQuery has been loaded, do this stuff this.evaluate(function() { isArticleOrReview = (jQuery('body').hasClass('node-type-review') || jQuery('body').hasClass(