PhantomJS——event 属性



它返回一个较长的事件列表,即修改符、键的详细信息等。

语法

其语法如下所示 -

var wpage = require('webpage').create();
wpage.event;

示例

我们举一个例子来了解 event 属性如何运作。

var page = require('webpage').create();
console.log(JSON.stringify(page.event));

以上程序会生成以下 输出

{"modifier":{"shift":33554432,"ctrl":67108864,"alt":134217728,"meta":268435456, " 
keypad":536870912},"key":{"0":48,"1":49,"2":50,"3":51,"4":52,"5":53,"6":54,"7": 
5 
5,"8":56,"9":57,"A":65,"AE":198,"Aacute":193,"Acircumflex":194,"AddFavorite":16
7 
77408,"Adiaeresis":196,"Agrave":192,"Alt":16777251,"AltGr":16781571,"Ampersand" : 
38,"Any":32,"Apostrophe":39,"ApplicationLeft":16777415,"ApplicationRight":16777
4 
16,"Aring":197,"AsciiCircum":94,"AsciiTilde":126,"Asterisk":42,"At":64,"Atilde" : 
195,"AudioCycleTrack":16777478,"AudioForward":16777474,"AudioRandomPlay":167774
7 
6,"AudioRepeat":16777475,"AudioRewind":16777413,"Away":16777464,"B":66,"Back":1
6 
777313}} 
phantomjs_webpage_module_properties.htm
广告