JQuery selector gives warning about global scope

I am trying to remove some of the nested ajax jQuery calls that I just wrote. If I move part of the code to another function, I get the following warning when executed.

"Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead." 

This is one of the calls that trigger this warning:

 var access_token = $("input#access_token").val(); 

Inside regular javascript is the top level of javascript ie Global. How to fix it?

Thanks.

+4
source share

Source: https://habr.com/ru/post/1381103/


All Articles