我的splash.js文件输出"无法获取/www/html/login.html"这是在纹波仿真器上测试时重定向到的页面。但是在我的设备上运行它可以使它工作。希望减少构建时间,因为与我的手机相比,在仿真器上测试它要快得多。
splash.js Javascript代码:
$(document).ready(function () {
swal({
title: "Hi!",
text: "Welcome to FarmVille",
imageUrl: "../www/images/ring-alt.gif",
showConfirmButton: false,
});
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
if (this.responseText == "success") {
setTimeout(function () { //page redirect after 2 seconds.
window.location.href = "../www/html/login.html";
}, 2000);
} else {
sweetAlert("Oops...", "There was an error connecting, try again!", "error");
document.getElementById("password").value = "";
}
}
}
xmlhttp.open("GET", "http://www.sampleee.esy.es/checkdbconnection.php", true);
xmlhttp.send();
});