码迷,mamicode.com
首页 > Web开发 > 详细

$.ajax({})

时间:2018-07-24 22:26:31      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:response   cat   方式   status   htm   nbsp   oca   function   red   

$.ajax({
                url : /delete/,  #地址
                type: POST,    #传输方式
                data: {nid: objs}, #传输数据
                dataType: JSON,   #传回来的数据格式
                traditional: true,    #传送列表元素
                success: function (obj) {
                     if(obj.status){
                         location.reload() #刷新页面
                     }

                }

            })

在html中的书写

 

 

在views中

import json 

red = {‘status’:True, ‘error’:None, ‘data‘:None}

nid = request.GET.get(‘nid‘)  #接收数据

 

return Httpresponse(json.dumps(red))

$.ajax({})

标签:response   cat   方式   status   htm   nbsp   oca   function   red   

原文地址:https://www.cnblogs.com/my-love-is-python/p/9362908.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!