在写<a>链接的href属性时 = 号 后面不能用空格,否则controller层接收不到参数值

       我们在编码时,总是习惯在 ' = '号前后加上空格,这样会让代码看起来更好看,但有一种情况是不可以在等号前后加空格的,否则会导致controller层接收不到参数值:

        这种情况就是在写<a>链接的href属性时;

今天写代码碰到了这样的情况

        我的<a>标签是这样写的:

<a href="message/messagemodal?registerid=' + item.user + '&suggestionId= '+item.id+'">回复</a>'
  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
优化这一段代码<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>qq登录</title> </head> <body style=" border: 1px solid; height: 400px; width: 450px; color: #555555; font: 12px; background-color: #ffff; position: absolute; left: 35%; " > <div style="height: 47.57px"> <img src="qq.png" alt="" width="56px" height="26px" style="margin: 10px 0px 0px 21px; font: 12px" /> </div> <div style="height: 344.42px; width: 433px"> <div style=" height: 28px; width: 406.86px; color: #000; font-size: 20px; margin: 16px 0px 6px; " > <p align="center">密码登录</p> </div> <div align="center" style="width: 406.86px; height: 16px; font-size: 12px" > 推荐使用 <a href="" style="text-decoration: none">快捷登录</a> ,防止盗 </div> <br /> <div align="center"> <input type="text" placeholder="请输入账" style="width: 242.14px; height: 33.14px" /><br /> <br /> <input type="text" placeholder="请输入密码" style="width: 242.14px; height: 33.14px" /><br /> <br /> <input type="submit" value="登录" style=" width: 250px; height: 38px; background-color: rgb(0, 119, 255); padding: 1px 6px; " /> </div> <br /> <br /> <div style="width: 406.86px; height: 16px; font-size: 12px"> <a href="" style="text-decoration: none; margin-left: 88px">找回密码</a ><a href="" style="text-decoration: none; margin-left: 50px">注册账</a ><a href="" style="text-decoration: none; margin-left: 50px" >意见反馈</a > </div> </div> </body> </html>
06-02

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值