美文网首页
前端发送json字符串

前端发送json字符串

作者: think_lonely | 来源:发表于2019-11-22 14:12 被阅读0次

前边

$.ajax({

            url:"/book/",

            type:"POST",

            data: {data:JSON.stringify(POST_DATA),date:CHOSEN_DATE,csrfmiddlewaretoken:'{{ csrf_token }}'},

            success:function(data){

                if(data.status){

                    location.href=""

                }

                else {

                    alert("不能选择其他人已预订的房间")

                    location.href=""

                }

            }

        })

    })

后边:

post_data = json.loads(request.POST.get('data'))

相关文章

网友评论

      本文标题:前端发送json字符串

      本文链接:https://www.haomeiwen.com/subject/shtqwctx.html