HTML5获取php数据的方法:
HTML代码
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0-rc1.js"></script>
</head>
<body>
<script type="text/javascript">
$(document).ready(function(){
$.ajax({
url:"sms.php",
type: "GET",
dataType: "text",
success: function(data){
alert(data);//$a的值
}
})
})
</script>
</body>
</html>
sms.php :
<?php
$a = 'aaaa';
echo $a;
?>
以上就是html5如何获取php数据的详细内容,更多请关注米米素材网其它相关文章!
发表评论