您好,欢迎来到筏尚旅游网。
搜索
您的当前位置:首页html5如何获取php数据

html5如何获取php数据

来源:筏尚旅游网

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;
?>

推荐:php服务器

Copyright © 2019- efsc.cn 版权所有 赣ICP备2024042792号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务