This is allowed for ReactNative apps. Source
AppHub.io is one option, open source coming soon.
function whatDoesItDo(val){ | |
return val ? 1 : 2; | |
} |
// Based on http://stackoverflow.com/a/10520017/1307721 and http://stackoverflow.com/a/16022728/1307721 | |
Podium = {}; | |
Podium.keydown = function(k) { | |
var oEvent = document.createEvent('KeyboardEvent'); | |
// Chromium Hack | |
Object.defineProperty(oEvent, 'keyCode', { | |
get : function() { |
China stock api | |
1.163_API(0-sh,1-sz):http://api.money.126.net/data/feed/1002151,0600036,hkHSI,hkHSCEI,hk00005 | |
2.QQ_API(sh,sz,s_simple data):http://qt.gtimg.cn/r=0.8409869808238q=s_sz000559,s_sz002434,s_sz002472,s_sz002488,hk00700 | |
3.sina_API(sh,sz,s_simple data):http://hq.sinajs.cn/list=sh600000,sh600004,hk00700,sz002594 | |
# 4.xueqiu_API:http://xueqiu.com/v4/stock/quote.json?code=02318,01211,SH000001,DJI30,HKHSI | |
163 | |
日内实时盘口(JSON): | |
http://api.money.126.net/data/feed/1000002,1000001,1000881,0601398,money.api |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
var chunkedUrl = 'https://jigsaw.w3.org/HTTP/ChunkedScript'; | |
fetch(chunkedUrl) | |
.then(processChunkedResponse) | |
.then(onChunkedResponseComplete) | |
.catch(onChunkedResponseError) | |
; | |
function onChunkedResponseComplete(result) { | |
console.log('all done!', result) | |
} |
1 copy the file into /etc/init.d/xvfb | |
2 chmod +x /etc/init.d/xvfb | |
3 ./etc/init.d/xvfb start | |
4 # some headless test here | |
5 ./etc/init.d/xvfb stop |