URL中参数的值有加号,虽然请求的URL中含有加号,但是GET的时候却得不到加号!

解决办法,用JavaScript的encodeURIComponent函数对加号进行编码。

如str="a+b";

url="sql_str.jsp?sql="+str;

要改成:

url="sql_str.jsp?sql="+encodeURIComponent(str);

相关文章:

  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-19
  • 2022-12-23
  • 2021-08-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
  • 2021-08-20
  • 2021-12-06
相关资源
相似解决方案