Javascript 角度2-发送url中带有哈希标记的值
在我的申请表中,我有一份注册产品的清单 我正在尝试在url中发送产品名称 但是,它有Javascript 角度2-发送url中带有哈希标记的值,javascript,angular,Javascript,Angular,在我的申请表中,我有一份注册产品的清单 我正在尝试在url中发送产品名称 但是,它有#标签的产品名称以及服务器上的产品名称不完整: 前端 var product = "PLASTIC #1JQ-M 1CV T-PLAS" return this._http.get(Config.URL_SITE + 'list/productLen?product='+product)... router.get('/productLen', function(req, res, next) { var
#
标签的产品名称以及服务器上的产品名称不完整:
前端
var product = "PLASTIC #1JQ-M 1CV T-PLAS"
return this._http.get(Config.URL_SITE + 'list/productLen?product='+product)...
router.get('/productLen', function(req, res, next) {
var productName= req.query.product;
console.log(productName) //PLASTIC
...
后端
var product = "PLASTIC #1JQ-M 1CV T-PLAS"
return this._http.get(Config.URL_SITE + 'list/productLen?product='+product)...
router.get('/productLen', function(req, res, next) {
var productName= req.query.product;
console.log(productName) //PLASTIC
...
如何使productName
变量接收全名?
“PLASTIC#1JQ-M 1CV T-PLAS”
在将产品名称添加到URL之前,应使用该功能
var product = "PLASTIC #1JQ-M 1CV T-PLAS"
return this._http.get(Config.URL_SITE + 'list/productLen?product=' + encodeURIComponent(product))...
散列后的所有内容都被浏览器剥离
也有其他解决方案:,但它们通常是如何在服务器上检索哈希。在将产品名称添加到URL之前,应该使用函数
var product = "PLASTIC #1JQ-M 1CV T-PLAS"
return this._http.get(Config.URL_SITE + 'list/productLen?product=' + encodeURIComponent(product))...
散列后的所有内容都被浏览器剥离
有其他解决方案:,但它们主要是如何在服务器上检索哈希