Javascript變數的應用
首先可以定義一個物件在window object中:
window.my_config =
{
my_var1 : 1,
my_var1 : 2,
my_var1 : 3
};
This would keep your scope neat and clean. And whenever you would access the global using
window.my_config
anyone looking at the code would know that a global is being accessed.
留言