分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 运营维护

jquery的ajax的语法

发布时间:2023-09-06 01:39责任编辑:白小东关键词:暂无标签
 1 <!doctype html> 2 <html lang="en"> 3 <head> 4 ????<meta charset="UTF-8"> 5 ????<title>jquery-ajax</title> 6 </head> 7 <body> 8 <input type="button" value="点击" id="btn"> 9 <div id="showInfo"></div>10 <script type="text/javascript" src="jquery-1.11.2.js"></script>11 <script type="text/javascript">12 ????$(function(){13 14 ????????$("#btn").click(function(){15 ????????????$.ajax({16 ????????????????url:"04data.php",17 ????????????????dataType:"json",18 ????????????????type:"get",19 ????????????????success:function(data){20 ????????????????????alert(data);21 ????????????????????//$("#showInfo").html(data);22 ????????????????},23 ????????????????error:function(e){24 ????????????????????console.log(e);25 ????????????????}26 ????????????});27 ????????});28 29 30 31 ????});32 33 </script>34 </body>35 </html>

<!doctype html><html lang="en"><head><meta charset="UTF-8"><title>jquery-ajax</title></head><body><input type="button" value="点击" id="btn"><div id="showInfo"></div><script type="text/javascript" src="jquery-1.11.2.js"></script><script type="text/javascript">$(function(){
$("#btn").click(function(){$.ajax({url:"04data.php",dataType:"json",type:"get",success:function(data){alert(data);//$("#showInfo").html(data);},error:function(e){console.log(e);}});});


});
</script></body></html>

jquery的ajax的语法

原文地址:https://www.cnblogs.com/sanerandm/p/8358980.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved