Ajax 使用传入的 # 调用 web2py request.vars 砍掉后面的部分
Ajax call in web2py with a # passed in request.vars chops the later part
var x = "www.something.com#something"
ajax("default?q="+x,"","");
这里在controller中,request.vars中得到的值只有www.something.com
代替
www.something.com#something
看起来 # 之后的任何内容都没有被考虑在内。
虽然它在通过 "name" 时工作正常,但不确定为什么这在上述情况下不起作用。请帮忙。
URL 中的 #
符号表示 fragment, a fragment is not likely to be included in request.vars
so you will need to encode the value q
with something like encodeURIComponent
在请求中发送之前。
var x = "www.something.com#something"
ajax("default?q="+x,"","");
这里在controller中,request.vars中得到的值只有www.something.com 代替 www.something.com#something
看起来 # 之后的任何内容都没有被考虑在内。
虽然它在通过 "name" 时工作正常,但不确定为什么这在上述情况下不起作用。请帮忙。
URL 中的 #
符号表示 fragment, a fragment is not likely to be included in request.vars
so you will need to encode the value q
with something like encodeURIComponent
在请求中发送之前。