【发布时间】:2015-12-16 14:33:10
【问题描述】:
我很难理解如何将 id 添加到 url 以向服务器发送请求。事实上,我的主要问题是第三个打开方法中等号后引号的位置。为什么在 Math.random() 或 .asp 之后不使用它。因为,如果我将引号放在 math.random() 之后,它会起作用,但在 math.random() 之前不起作用。我想了解这里的引号是什么变化...
xhttp.open(method, url, async);
xhttp.send();
xhttp.open("GET", "demo_get.asp", true);
xhttp.send();
**xhttp.open("GET", "demo_get.asp?t=" + Math.random(), true);**
xhttp.send();
例如,我了解以下网址中发生的情况。
http://localhost/test.php?q=_&p1=_&p2=_
? 让服务器知道?_GET 变量的开头
q、p1 和 p2 是参数,_ 是值
【问题讨论】: