<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/ html; charset=utf-8" />
<title>Contact Example</title>
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8">
document.write("loading PhoneGap");
document.addEventListener("deviceready", onDeviceReady, false);
document.write("PhoneGap loaded");
function onDeviceReady() {
alert("begin");
var myContact = navigator.service.contacts.create({"displayName": "Test User"});
myContact.gender = "male";
document.write("The contact, " + myContact.displayName + ", is of the " + myContact.gender + " gender");
alert("end");
}
</script>
</head>
<body>
<h1>Example</h1>
<p>Create Contact</p>
</body>
</ html>
在Android的Eclipse的仿真結果是:有一些問題 「的console.log」
loadingPhoneGap的PhoneGap加載 例 創建聯繫人
「警報」 缺失,似乎那個功能不起作用,問題是什麼?