代码区项目交易流程

Window object in PhantomJS


I have seen in some documentation of PhantomJS that it can access the global "document" object but I don't know if it is also possible to access the global "window" object.

So my question is, is there a special way or I can just call the window object directly after I initialize a page using PhantomJS?

Problem courtesy of: Richeve Bebedor

Solution

Running phantomjs from a terminal gives you an interactive session you can play around with.

If you then run console.log(window) you'll see you have access to the window object.

phantomjs> console.log(window); [object DOMWindow]

Solution courtesy of: Liam Newmarch

本文前端(javascript)相关术语:javascript是什么意思 javascript下载 javascript权威指南 javascript基础教程 javascript 正则表达式 javascript设计模式 javascript高级程序设计 精通javascript javascript教程

点击收藏

LAST Bananagrams Solver in JavaScript, PHP & MySQL iOS混合开发库(GICXMLLayout)二、功能、架构介绍 NEXT