I met this issue sometimes but still don't know what causes it.
I have this script in the page:
$(function(){
var value = "10";
});
But the browser says "ReferenceError: value is not defined". However if I go to the browser console and input either
10
or
var value = "10";
either of them can return 10. What is the problem with my script?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…