저는 appMobi, HTML 및 JavaScript가 새로 도입되었습니다. 내가 원하는 것은 onClick 메서드가있는 버튼이 있으며이 메서드는 아무 것도 수행해야한다는 것입니다. 스크립트를 정의했지만 단추가 있지만 메서드가 호출되지 않습니다. 누군가 내 이유를 말해 줄 수 있습니까? appMobi에서 제공하는 예제는 전혀 다른 작업을 수행하지 않습니다.appMobi onClick가 작동하지 않습니다.
<head>
<!-- the line below is required for access to the appMobi JS library -->
<script type="text/javascript" charset="utf-8" src="http://localhost:58888/_appMobi/appmobi.js"></script>
<script type="text/javascript" language="javascript">
// This event handler is fired once the AppMobi libraries are ready
function onDeviceReady() {
//use AppMobi viewport to handle device resolution differences if you want
//AppMobi.display.useViewport(768,1024);
//hide splash screen now that our app is ready to run
AppMobi.device.hideSplashScreen();
}
//initial event handler to detect when appMobi is ready to roll
document.addEventListener("appMobi.device.ready",onDeviceReady,false);
function myfunction(){
AppMobi.debug.log("test");
alert("Hallo Welt");
}
</script>
<script type="text/javascript">
function myfunction(){
AppMobi.debug.log("test");
alert("Hallo Welt");
}
</script>
</head>
<body >
<br>
<button onclick="myfunction();">MyButton</button>
</body>
아무도 아이디어가 없습니까? :/ – chris13