我想传递一个像这样的 url:
localhost:9090/admin/GroupInfo.action?message=redirect.jsp?sop=here&something=other
我想接收“redirect.jsp?sop=here&something=other
”作为参数“message
”的值,但我只收到“ redirect.jsp?sop=here
"在服务器上。它可能将 sop 视为父 url 的另一个参数。如何避免这种情况?
我尝试通过将其替换为 &
来转义第二个 '&'
但它不起作用
最佳答案
encodeURIComponent("redirect.jsp?sop=here&something=other");
关于javascript - 如何在 url 参数中包含 url 参数(它将嵌套参数视为原始请求的参数),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13178902/