我遇到了一些我无法理解的事情:
我的index.html中有以下几行:
<button id="btn1" type="button">Click Me</button>
<script type="text/javascript" src="scripts/camera.js"></script>
<p id="DebugMessagesOnScreen">SomeMessage</p>
和一个带有以下行的camera.js文件:
function doStuff() {
document.getElementById("DebugMessagesOnScreen").innerHTML = "ButtonPressed";
}
document.getElementById("btn1").addEventListener('click', doStuff);
现在,在模拟器上 - 按下按钮时 -
中的“SomeMessage”<p id="DebugMessagesOnScreen">SomeMessage</p>
按预期更改“ButtonPressed”。
然而 - 点击真实Android设备上的按钮不会改变文本。 (按钮本身似乎对印刷机做出反应,因为每次按下它时都会闪烁/刷新)。
我认为这是控制台的向下/向上按钮按下部分:
D/InputReader( 738): AP_PROF:AppLaunch_dispatchPtr:Down:459601588, ID:0, Index:2083680096
I/AP_PROF ( 738): unable to open /proc/mtprof/status entry
D/PowerManagerService( 738): userActivityFromNative
W/ResourceType(19662): No package identifier when getting name for resource number 0x00000064
D/PowerManagerService( 738): userActivityNoUpdateLocked: eventTime=459601588, event=2, flags=0x0, uid=1000
D/PowerManagerNotifier( 738): onUserActivity: event=2, uid=1000
D/PowerManagerService( 738): updateUserActivitySummaryLocked: mWakefulness=Awake, mUserActivitySummary=0x1, nextTimeout=459715588 (in 113997 ms)
D/PowerManagerService( 738): newScreenState = 2
I/View (19662): Touch down dispatch to org.apache.cordova.engine.SystemWebView{42178518 VFEDH.C. .F...... 0,0-1280,670 #64}, event = MotionEvent { action=ACTION_DOWN, id[0]=0, x[0]=49.960968, y[0]=104.78502, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=459601588, downTime=459601588, deviceId=2, source=0x1002 }
D/PowerManagerDisplayController( 738): requestPowerState: screenState=2, useProximitySensor=false, forceProximitySensorEnable=false, forceWakeUpEnable=false, screenBrightness=204, screenAutoBrightnessAdjustment=0.0, useAutoBrightness=false, useEcoBrightness=false, blockScreenOn=false, waitForNegativeProximity=false
I/PowerManagerService( 738): setBrightness mButtonLight 0.
D/PowerManagerService( 738): updateScreenStateLocked: mDisplayReady=true, newScreenState=2, mWakefulness=1, mWakeLockSummary=0x0, mUserActivitySummary=0x1, mBootCompleted=true
D/PowerManagerService( 738): handleSandman: canDream=false, mWakefulness=Awake
D/OpenGLRenderer(19662): prepareDirty (0.00, 0.00, 1280.00, 720.00) opaque 1 <0x7cbca060>
D/OpenGLRenderer(19662): finish <0x7cbca060>
D/InputReader( 738): AP_PROF:AppLaunch_dispatchPtr:Up:459601613, ID:0, Index:2083681392
有什么想法吗?
由于 奥弗。