<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0" />
<title>Sample</title>
<script src="cordova-2.7.0.js" type="text/javascript"></script>
<script type="text/javascript">
if (!navigator.userAgent.toLowerCase().match('chrome')) {
document.write("<script src='phonegap.js'><\/script>");
}
</script>
</head>
<body onload="onLoaded()">
<div class="info" style="font-size:12px">CCN TEST</div>
<script>
function onLoaded() {
document.addEventListener("deviceready", onDeviceReady, false);
}
function onDeviceReady() {
//window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess, onError);
window.resolveLocalFileSystemURI("file:///mnt/sdcard/example.txt", onSuccess, onError);
}
function onSuccess(fileEntry){
alert(fileEntry.name);
alert(fileEntry.fullPath);
}
function onError(err){
alert(err.code);
}
</script>
</body>
</html>
- Jun 06 Fri 2014 15:36
[PhoneGap] 讀取檔案名稱、檔案絕對路徑
全站熱搜
留言列表
發表留言