【发布时间】:2016-03-01 20:11:42
【问题描述】:
我想在 android 移动应用程序中显示我的 php 页面。我使用cordova,并在我的项目中添加了一个带有此目录“php/load.php”的php页面。我试图在 index.html 上显示这个页面我试过这样但它不起作用。
<button type="submit" onclick="show();">Show it</button>
<script type="text/javascript">
$(document).ready(function() {
function show(){
$.ajax({
method: 'GET',
url: 'php/load.php',
dataType: 'text'
})
.done(function(data) {
alert(data);
})
alert("Pause");
}
});
});
</script>
这是我的 php 文件:
<?php
$a = "AAAAAAAA";
echo $a ;
?>
【问题讨论】:
标签: php android jquery ajax cordova