버튼을 사용하여 자바 스크립트 기능을 호출 할 수 없으며 서클에서 실행되기 시작했습니다. 나는이 지역에서 경험이 많지 않습니다. 그리고 저에게는 제가 본 모든 예처럼 보입니다.Phonegap 버튼 클릭 이벤트
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title>BONJA</title>
</head>
<body>
<div class="app">
<div class="wrapper">
<div class="content">
<div class="head">
<img src="res/logo/institucional.png" />
</div>
<div class="container">
<form>
<input type="button" value="Fazer Login" onclick="login()" class="button" id="loginClick" />
</form>
</div>
<div id="deviceready" class="blink">
<p class="event notConnected">Não conectado</p>
<p class="event connecting">conectando</p>
<p class="event connected">conectado</p>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="phonegap.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
app.initialize();
</script>
<script type="text/javascript">
function login() {
//initialize login
var parentElement = document.getElementByID('deviceready');
var notConnectedElement = parentElement.querySelector('.notConnected');
var connectingElement = parentElement.querySelector('.connecting');
notConnectedElement.setAttribute('style', 'display:none;');
connectingElement.setAttribute('style', 'display:block;');
alert("Hello world!");
}
</script>
</body>
그런데 아이폰 시뮬레이터에
임 테스트 다. 당신의 도움이
전체 HTML을 공유 할 수 있습니까? –
... 전체 HTML을 추가했습니다 – Johannes
답변 올리기 ....! –