ajax+jquery+django
来源:互联网 发布:鲍尔夏季联赛数据 编辑:程序博客网 时间:2024/06/10 14:47
前端的ajax+jquery+django服务端
前端代码:
第一种,直接用$.post或者$.get发送,具体参数为
$.post(url,[data],[calback],[type])
$.get(url,[data],[callback])
以post方式发送为例:
$(document).ready(function () { $('#jqueryajax').click(function(){ $.post('/home/back/',{name:'chen', age:12}, function(data){ alert(data) } ); }); });
$(document).ready(function () { $('#jqueryajax').click(function(){ $.ajax({ type:'POST', url:'/home/back/', data:{name:'nataila', age:35}, success:function(data){ alert(data) } }); }); });
后端代码是不变的:
def back(request):>---if request.method == 'POST':>--->---content = request.POST.get('name')>--->---print request.POST>--->---return HttpResponse('POST receive success, name is ' + content)>---else:>--->---content = request.GET.get('name')>--->---return HttpResponse('GET receive success, name is ' + content)
此文仅供新手参考
0 0
- ajax+jquery+django
- Django+jQuery框架下使用AJAX笔记
- 十九 Django 1.5.4 jquery ajax bootstrap
- jquery与django实现ajax通信
- jquery解释django+ajax+json的数据
- Native Ajax in Django and jQuery
- Django+Ajax+jQuery实现网页动态更新
- JQuery & Django Ajax 踩过的坑
- django 1.4 利用jquery实现ajax ‘get|post’异步请求
- How to POST a django form with AJAX & jQuery
- 使用json进行ajax通信(django/jquery)
- 小栗子说明Django中如何使用JQuery实现Ajax
- Ajax 和 jQuery 实现进度条+上传文件到Django
- django 用jquery ajax提交form 实现刷新部分页面
- Django+Jquery+Ajax+验证码登录案例系列之十二
- 第五篇文章:在Django中用Jquery实现Ajax
- Django ajax
- Django AJAX
- 利用淘宝IP查询接口,免费查询IP归属地
- struts的简单实现
- Treeview 鼠标悬停时的问题提示
- Ubuntu系统启动报错:The system is running in low-graphics mode
- iproute2 策略路由与流量控制笔记
- ajax+jquery+django
- oracle查看编码以及修改编码
- cocos2dx TiledMap
- SNS 即时通讯项目性能优化
- android:scaleType属性解读
- TRACY自己学英语的5W三七法则
- VSTS修改密码 control userpasswords2
- 泛型--浅谈在实际中的应用一
- ORA-01033: ORACLE initialization or shutdown in progress的两种解决方法