Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8392399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:30:34+00:00 2026-06-09T19:30:34+00:00

Why when I use console.log in evaluate , it works: casper.then(function() { this.evaluate( function()

  • 0

Why when I use console.log in evaluate, it works:

casper.then(function() {
  this.evaluate( function() {
    console.log('hello'); 
  });
});

But this doesn’t work:

casper.then(function() {
  this.evaluate( function() {
    setTimeout( function() {console.log('hello');}, 1000);
  });
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T19:30:35+00:00Added an answer on June 9, 2026 at 7:30 pm

    Because you’re mixing up casperjs and remote page environments. The evaluate function will execute code within the remote page env, so the console.log call won’t output anything.

    If you want to catch remote console.log calls, listen to the remote.message event:

    casper.on('remote.message', function(msg) {
        this.echo('remote message caught: ' + msg);
    })
    

    Btw, documentation for events is pretty much exhaustive, as well as the one for evaluate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

if i use this: $(document).ready(function() { pjs = Processing.getInstanceById(EyeCanvas); console.log(pjs); } then pjs is
if I use: jQuery(document).ready(function() { console.log($(this)); }); then in console I have object: [Document
google.visualization.events.addListener( geomap, regionClick, function(e) { console.log(e[region]); console.log(data.getValue(e[region],1)); }); I use this code to see
When we use the console.log(someObject.someFunction) firebug shows function() string only. Is there a way
The following JS: (function() { use strict; $(#target).click(function(){ console.log(clicked); }); }()); Yields: test.js: line
When I use $(document).ready(function() { var bodyHeight = $(body).height(); console.log(bodyHeight); }); I get a
When I use this code the console.log and the value in the field disappear
function Foo() { this.SayFoo = function() { console.log('Foo'); }; } function Bar() { this.SayBar
Consider this piece of code var crazy = function() { console.log(this); console.log(this.isCrazy); // wrong.
this is my code : <p ><script>console.log($(this).parent())</script></p> <p ><script>console.log($(this).parent())</script></p> <p ><script>console.log($(this).parent())</script></p> <p ><script>console.log($(this).parent())</script></p> but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.