Skip to content

Instantly share code, notes, and snippets.

@jonleighton
Created June 13, 2012 18:23
Show Gist options
  • Select an option

  • Save jonleighton/2925648 to your computer and use it in GitHub Desktop.

Select an option

Save jonleighton/2925648 to your computer and use it in GitHub Desktop.
$ phantomjs test.js
error: ReferenceError: Can't find variable: foo
finished
error: ReferenceError: Can't find variable: asdasd
<script type="text/javascript">
setTimeout(function() { asdasd }, 500)
foo
</script>
page = new WebPage()
page.onError = function(e) {
console.log("error: " + e)
}
page.open('file:///home/turnip/Desktop/test.html', function() {
console.log("finished")
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment