bmcjxhgwy's recent timeline updates
bmcjxhgwy

bmcjxhgwy

V2EX member #256322, joined on 2017-09-25 18:28:04 +08:00
请教一下 mysql 中如何定义一个为列表的常量啊?
Python  •  bmcjxhgwy  •  Nov 11, 2019  •  Lastly replied by bmcjxhgwy
3
请教一下 mysql 中能否定义一个为列表的常量啊?
MySQL  •  bmcjxhgwy  •  Nov 13, 2019  •  Lastly replied by gigantic222
2
Python open 函数
Python  •  bmcjxhgwy  •  Apr 2, 2018  •  Lastly replied by frostming
8
请教个 Python 读写文件问题
Python  •  bmcjxhgwy  •  Mar 29, 2018  •  Lastly replied by qyzxgl
1
请教下 fidder 问题
Python  •  bmcjxhgwy  •  Mar 23, 2018  •  Lastly replied by evagreenworking
14
请教下 pycharm 的问题
问与答  •  bmcjxhgwy  •  Mar 13, 2018
问个 ajax 的问题,谢谢帮助
Python  •  bmcjxhgwy  •  Mar 4, 2018  •  Lastly replied by zhwithsweet
28
为什么用密码 ssh 连不进自己的 ubuntu 虚拟机里啊?
Python  •  bmcjxhgwy  •  Oct 23, 2017  •  Lastly replied by teemoer
5
bmcjxhgwy's recent replies
非常感谢,已解决
Mar 30, 2018
Replied to a topic by bmcjxhgwy Python Python open 函数
@layorlayor 以前好像是 python3 版本 这次是 python2 版本
Mar 30, 2018
Replied to a topic by bmcjxhgwy Python Python open 函数
@ballshapesdsd 不是编码,而是格式问题...直接显示 unexpected arguments ( s )了..我记得以前这么写是可以的
Mar 23, 2018
Replied to a topic by bmcjxhgwy Python 请教下 fidder 问题
那有没有什么解决方法啊?
Mar 3, 2018
Replied to a topic by 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)
}
})
Mar 3, 2018
Replied to a topic by bmcjxhgwy Python 问个 ajax 的问题,谢谢帮助
Mar 3, 2018
Replied to a topic by bmcjxhgwy Python 问个 ajax 的问题,谢谢帮助
@sublime fn_cb 是什么....我也觉得是数据格式不对
Mar 3, 2018
Replied to a topic by 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})
Mar 3, 2018
Replied to a topic by bmcjxhgwy Python 问个 ajax 的问题,谢谢帮助
序列化了好像也没什么用.....
Mar 3, 2018
Replied to a topic by bmcjxhgwy Python 问个 ajax 的问题,谢谢帮助
我用了 jsonp 应该不会有跨域的请求..
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3502 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 27ms · UTC 11:28 · PVG 19:28 · LAX 04:28 · JFK 07:28
♥ Do have faith in what you're doing.