Примечания. Использование PhoneGap Desktop в Windows 10 Pro v0.4.5.Когда я пытаюсь запустить приложение, сервер PythonAnywhere не получает запрос jQuery Ajax.Это из-за ошибки, вызванной неправильной загрузкой cordova_plugins.js?Что можно сделать для правильной загрузки и устранения ошибок?
Полное сообщение об ошибке:
GET http://192.168.56.1:3000/cordova_plugins.js net::ERR_ABORTED 500 (Internal Server Error)
exports.injectScript @ cordova.js:1528
injectIfNecessary @ cordova.js:1536
exports.load @ cordova.js:1616
(anonymous) @ cordova.js:1129
setTimeout (async)
(anonymous) @ cordova.js:1128
build @ cordova.js:53
require @ cordova.js:68
(anonymous) @ cordova.js:1861
(anonymous) @ cordova.js:1863
Код JavaScript / HTML
<!DOCTYPE html>
<html>
<head>
<title>My Mobile Application</title>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile.structure-1.4.5.min.css"/>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<script src="js/scripts.js"></script>
<style>
body{
background: url(images/background.png) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.headerText{
color: white;
}
#searchForHouses{
background: transparent;
/*border: 1px solid gray;*/
color: white;
}
.feature{
width: 88%;
height: 70%;
/*margin: 10%;*/
background-color: white;
position: absolute;
border-radius: 5px;
padding: 5px;
}
a{
text-decoration: none;
}
</style>
</head>
<body>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript">
function getDataForSearch(){
alert("Button clicked")
$.ajax({
type: "POST",
headers:{'Access-Control-Allow-Origin':'*'},
url: "[username].pythonanywhere.com/getData",
data: {
requesttype: "getSearchData",
},
success: function(results){
alert(results)
},
error: function(error){
alert("Error: "+error)
}
})
}
function functionOne(){
// alert("Href Clicked")
}
</script>
<div data-role="page" id="pageone" data-theme="a">
<div data-role="header">
<h1 class='headerText'>RealEstate.com.au</h1>
</div>
<div data-role="main" class="ui-content">
<a href="#pagetwo" onclick="functionOne()"><button onclick="getDataForSearch()" id='searchForHouses'>Search for Houses</button></a>
<div class='feature'>
f
</div>
</div>
<!-- <div data-role="footer">
<h1>Footer Text</h1>
</div> -->
</div>
<div data-role="page" id="pagetwo" data-theme="b">
<div data-role="header">
<h1 class='headerText'>RealEstate.com.au</h1>
</div>
<div data-role="main" class="ui-content">
<a href="#pageone">Go to Page One</a>
</div>
<!-- <div data-role="footer">
<h1>Footer Text</h1>
</div> -->
</div>
</body>
</html>