jQuery 选择器给出有关全局范围的警告
我正在尝试整理我刚刚编写的一些嵌套 jQuery ajax 调用。如果将一些代码移出到另一个函数中,我在执行时会收到以下警告。
"Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead."
这是触发该警告的调用之一:
var access_token = $("input#access_token").val();
它位于 javascript 顶层的常规 javascript 中,即全局。如何解决这个问题?
谢谢。
I'm trying to tidy up some nested jQuery ajax calls that I have just written. If move some of the code out into another function I get the following warning upon execution.
"Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead."
This is one of the calls that is triggering that warning:
var access_token = $("input#access_token").val();
It's inside a regular javascript out the top level of javascript i.e. Global. How to go about fixing this?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论