weixin_33725722 2016-08-31 09:19 采纳率: 0%
浏览 444

如何使用Ajax通过url传递键值对?

我想在我的页面上使用Ajax,并通过url传递键值对设置。

xhttp.open("POST", "/ajax/myjsp.jsp?str=key1=value1|key2=value2" , true);

在执行myjsp.jsp上的request.getParameters(“str”)时,它应该给key 1=value 1 x key2=value 2。

  • 写回答

2条回答 默认 最新

  • weixin_33691700 2016-08-31 09:26
    关注

    It worked as it is posted in my question.The error was it was not getting ajax file path.Just removed / in the beginning and it worked.

    评论

报告相同问题?