bmcjxhgwy 最近的时间轴更新
bmcjxhgwy

bmcjxhgwy

V2EX 第 256322 号会员,加入于 2017-09-25 18:28:04 +08:00
请教一下 mysql 中如何定义一个为列表的常量啊?
Python  •  bmcjxhgwy  •  2019 年 11 月 11 日  •  最后回复来自 bmcjxhgwy
3
请教一下 mysql 中能否定义一个为列表的常量啊?
MySQL  •  bmcjxhgwy  •  2019 年 11 月 13 日  •  最后回复来自 gigantic222
2
Python open 函数
Python  •  bmcjxhgwy  •  2018 年 4 月 2 日  •  最后回复来自 frostming
8
请教个 Python 读写文件问题
Python  •  bmcjxhgwy  •  2018 年 3 月 29 日  •  最后回复来自 qyzxgl
1
请教下 fidder 问题
Python  •  bmcjxhgwy  •  2018 年 3 月 23 日  •  最后回复来自 evagreenworking
14
请教下 pycharm 的问题
问与答  •  bmcjxhgwy  •  2018 年 3 月 13 日
问个 ajax 的问题,谢谢帮助
Python  •  bmcjxhgwy  •  2018 年 3 月 4 日  •  最后回复来自 zhwithsweet
28
为什么用密码 ssh 连不进自己的 ubuntu 虚拟机里啊?
Python  •  bmcjxhgwy  •  2017 年 10 月 23 日  •  最后回复来自 teemoer
5
服务器 xshell4 连接和下载问题,望各位大佬解答下问题
问与答  •  bmcjxhgwy  •  2017 年 10 月 19 日  •  最后回复来自 msg7086
2
bmcjxhgwy 最近回复了
2019 年 11 月 11 日
回复了 bmcjxhgwy 创建的主题 Python 请教一下 mysql 中如何定义一个为列表的常量啊?
非常感谢,已解决
2018 年 3 月 30 日
回复了 bmcjxhgwy 创建的主题 Python Python open 函数
@layorlayor 以前好像是 python3 版本 这次是 python2 版本
2018 年 3 月 30 日
回复了 bmcjxhgwy 创建的主题 Python Python open 函数
@ballshapesdsd 不是编码,而是格式问题...直接显示 unexpected arguments ( s )了..我记得以前这么写是可以的
2018 年 3 月 23 日
回复了 bmcjxhgwy 创建的主题 Python 请教下 fidder 问题
那有没有什么解决方法啊?
2018 年 3 月 3 日
回复了 bmcjxhgwy 创建的主题 Python 问个 ajax 的问题,谢谢帮助
@sublime 改了后现在服务器端报 500 错误...

def test(request):
if request.method == "GET":
name = request.GET.get("name")
print(name)
return HttpResponse("func({'res':0})")
else:
name = request.POST.get("name")
print(name)
return HttpResponse("func({'res':1})")


$.ajax({
url:'http://127.0.0.1:8000/laoguo/',
type:'get',
data:{'name':'laoguo'},
dataType:'jsonp',
success:function func(data){
if(data.res == 0){
alert('get')
}else{
alert('error')
}
},
error:function func(data){
alert(data.res)
}
})
2018 年 3 月 3 日
回复了 bmcjxhgwy 创建的主题 Python 问个 ajax 的问题,谢谢帮助
2018 年 3 月 3 日
回复了 bmcjxhgwy 创建的主题 Python 问个 ajax 的问题,谢谢帮助
@sublime fn_cb 是什么....我也觉得是数据格式不对
2018 年 3 月 3 日
回复了 bmcjxhgwy 创建的主题 Python 问个 ajax 的问题,谢谢帮助
这是 ajax:
$(function(){
$('#send-btn').click(function(){
$.ajax({
url:'http://127.0.0.1:8000/laoguo/',
type:'get',
data:{'name':'laoguo'},
dataType:'jsonp',
success:function(data){
if(data.res == 0){
alert('get')
}else{
alert('....')
}
},
error:function(data){
alert(data.res)
}
})
})
})

这是 django 的 view:
def test(request):
if request.method == "GET":
name = request.GET.get("name")
print(name)
return JsonResponse({"res":0})
else:
name = request.POST.getlist("name")
print(name)
return JsonResponse({"res":1})
2018 年 3 月 3 日
回复了 bmcjxhgwy 创建的主题 Python 问个 ajax 的问题,谢谢帮助
序列化了好像也没什么用.....
2018 年 3 月 3 日
回复了 bmcjxhgwy 创建的主题 Python 问个 ajax 的问题,谢谢帮助
我用了 jsonp 应该不会有跨域的请求..
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   1310 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 20ms · UTC 17:24 · PVG 01:24 · LAX 09:24 · JFK 12:24
♥ Do have faith in what you're doing.