0

Can somebody tell me what is wrong with my syntax? While running this code in trifle JS it tells me that

. is unexpected at (2,4).

var page = require('webpage').create(),
    page.open("http://www.phantomjs.org", function(status) {
        if ( status === "success" ) {
            page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", function() {
                console.log(page.evaluate(function() {
                    return $("#intro").text();
                }));
                phantom.exit();
            });
        }
    });
Artjom B.
  • 61,146
  • 24
  • 125
  • 222
Aero
  • 117
  • 2
  • 8

1 Answers1

0

The problem is the ; at the end of the first line. This assumes that you define a variable in the next line which you don't do anymore. Exchange it with a semicolon:

var page = require('webpage').create();
page.open("http://www.phantomjs.org", function(status) {
    //...
});
Artjom B.
  • 61,146
  • 24
  • 125
  • 222