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 8113453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:50:06+00:00 2026-06-06T02:50:06+00:00

I have a problem with JavaScript magic. When I execute this code: var page

  • 0

I have a problem with JavaScript magic. When I execute this code:

var page = require('webpage').create();
var url="http://google.com";
page.open(url, function (status){
  if (status!== "success") {
    console.log("Fail to load: "+url)
  }else{
    console.log('1');
    page.evaluate(function() {
      console.log('2');
      });   
    console.log('3');
  }
phantom.exit();
});

console have only 1 and 3 and no 2. Can anyone say why?

If I paste after my code DOM manipulation example (but it never execute) I have my two. Did I forget something important?

  • 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-06T02:50:08+00:00Added an answer on June 6, 2026 at 2:50 am

    PhantomJS won’t log console messages in .evaluate() statements by default. Just include

    page.onConsoleMessage = function (msg) {
        console.log(msg);
    };
    

    See this page for more details/in-depth example:

    http://code.google.com/p/phantomjs/wiki/QuickStart#Code_Evaluation

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

Sidebar

Related Questions

I have this Javascript problem I cannot solve. My code is: <script type=text/javascript> var
I have problem with javascript code. I am using google maps and I am
I have a problem with Javascript Literal functions. for (curitem in array) { var
I have a problem with a javascript set of functions that I made. This
Hi I have a problem with a javascript string var foo = \<a href=javascript(foo('a','b'))>test</a>\
I have a problem when call applet method from javascript.. I used this function
I have problem calling a JavaScript function in an iframe from the parent page.
I have problem with ajax and php.I have next code $(form).submit(function() { var poruka
I have experienced a weird problem with javascript. The problem page uses some jQuery
i have problem this is javascript function its dont show the image in background.

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.