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
廣告
© . All rights reserved.