为什么在 javascript 中使用 oReq 作为新的 http 请求对象的对象名称?
Why is oReq used as the object name for a new http request object in javascript?
我在这里和 MDN 上搜索过。我还没有找到答案。这看起来微不足道,看起来您可以将对象命名为 var blahBlah = new XMLHttpRequest();
之类的任何名称,然后继续执行其余代码。
我只是想确保我明白我在做什么。
oReq
这里只是变量的名称,你可以随意命名(包括blahBlah
)。
在 a different page 上,他们调用了变量 httpRequest
。
在 W3C 的 XMLHttpRequest Level 1 specification 上,他们始终将变量命名为 client
。
作为 关于你的问题:
The actual name of a variable is only of importance to the developer / the reader of the source code. It is of no relevance to the actual execution of the code.
我在这里和 MDN 上搜索过。我还没有找到答案。这看起来微不足道,看起来您可以将对象命名为 var blahBlah = new XMLHttpRequest();
之类的任何名称,然后继续执行其余代码。
我只是想确保我明白我在做什么。
oReq
这里只是变量的名称,你可以随意命名(包括blahBlah
)。
在 a different page 上,他们调用了变量 httpRequest
。
在 W3C 的 XMLHttpRequest Level 1 specification 上,他们始终将变量命名为 client
。
作为
The actual name of a variable is only of importance to the developer / the reader of the source code. It is of no relevance to the actual execution of the code.