I am fairly new to PhoneGap and I am using the below snippet of code to download a file into the app, so that it can be used later in other screens. But my app is not showing any alert message and I am not sure how do I debug this.
Note: I have installed file and file-transfer plugins for phonegap.
Code Snippet: (Copied from another thread and trying to learn from it)
<body>
Testing file transfer 3.
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript" src="js/jQuery_v3_3_1.js"></script>
<script type="text/javascript">
app.initialize();
function storeIntelligrapeLogo(){
var url = "https://extranet.bwfbadminton.com/docs/players/50906/profile/50906.jpg"; // image url
document.addEventListener("deviceready", function() {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fs) {
var imagePath = fs.root.fullPath + "/logo.png"; // full file path
var fileTransfer = new FileTransfer();
fileTransfer.download(url, imagePath, function (entry) {
alert(entry.fullPath); // entry is fileEntry object
}, function (error) {
alert("Error");
alert(error);
});
});
}, false);
}
storeIntelligrapeLogo();
</script>
</body>