使用Angular在URL的查询字符串中将井号传递为值 [英] Passing a pound sign as a value in the query string of a URL, using Angular

查看:41
本文介绍了使用Angular在URL的查询字符串中将井号传递为值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个输入标签,在输入时,它将根据输入值过滤表中的数据列表.该值是通过请求URL中的查询字符串传递的.通常,我会返回数据并适当地更新表.但是,当搜索井号(#)时,我收到500内部服务器错误.我的问题是,在查询字符串中传递井号时,Angular是否存在已知问题?

I have an input tag and on input it will filter a list of data in a table according to the input value. That value is passed via the query string in the request URL. Typically I get data returned and the table is updated appropriately. However, when searching for the pound sign (#), I am receiving a 500 internal server error. My question is there a known issue with Angular when passing a pound sign in the query string?

推荐答案

传递保留的字符在网址中,您需要使用百分比编码.对于#,它是%23 .

To pass reserved characters in URLs, you need to use percent encoding. For #, it's %23.

百分比编码的维基百科页面上有一个很好的

The wikipedia page for Percent Encoding has a nice lookup table.

这篇关于使用Angular在URL的查询字符串中将井号传递为值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆