Using xmlhttp.open() how do I add more than one pa

2019-06-07 12:13发布

I have this code.

xmlhttp.open("GET","getuser.php?q="+str,true);

where q="+str

I want to pass a second var how do I do this?

2条回答
一纸荒年 Trace。
2楼-- · 2019-06-07 12:50
xmlhttp.open("GET","getuser.php?q=" + q + "&r=" + r, true);

Note that this will not properly escape your parameters if they contains special characters. You might want to use something like encodeURIComponent(q) instead.

查看更多
戒情不戒烟
3楼-- · 2019-06-07 12:55

Append + "&anotherVar=" + anotherString.

查看更多
登录 后发表回答