my-app.js code is as follows:
// Initialize your app
// var myApp = new Framework7();
var myApp = new Framework7({
animateNavBackIcon:true,
template7Pages: true,
precompileTemplates: true
});
// Export selectors engine
var $$ = Dom7;
// Add view
var mainView = myApp.addView(’.view-main’, {
// Because we use fixed-through navbar we can enable dynamic navbar
dynamicNavbar: true
});
// Funcion to handle Submit button on Login page
$$(’#submmit-login’).on(‘click’, function () {
var username = $$('#username').val();
var password = $$('#password').val();
if (!username || !password){
myApp.alert('Attention! Please fill in all Registration form fields');
return;
}
console.log('Submit clicked');
console.log('username: ' +username);
console.log('password: ' +password);
myApp.showIndicator();
$$.ajax({
url: 'https://tdcmobilestore.com.ng/apimobileapp/auth.php',
method: 'POST',
data: {
username: username,
password: password
},
success: function(response){
myApp.hideIndicator();
var reply = response.replace(/\s+/, ""); //remove any trailing white spaces from returned string
let obj = JSON.parse(reply);
if(obj.response == "OK"){
localStorage.setItem("username", username);
localStorage.setItem("password", password);
myApp.alert('Success ! You Have Logged In');
window.location= 'great.html';
}
else{
myApp.alert('ERROR. FROM DB' + reply);
}
},
error: function(response){
myApp.alert('ERROR FROM AJAX' + response);
}
});
});
When I tried to debug it, the Console returned the following:
[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080
y @ framework7.min.js:18
Submit clicked
my-app.js:35 username: save
my-app.js:36 password: many
framework7.min.js:21 POST https://tdcmobilestore.com.ng/apimobileapp/auth.php 404 (Not Found)
a.ajax @ framework7.min.js:21
(anonymous) @ my-app.js:45
C @ framework7.min.js:18
T @ framework7.min.js:18
The code works perfectly well on my Laptop Browser but when I run it on an Android Device it does not work
Please I need your assistance on this.