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 usingwindow.my_config anyone looking at the code would know that a global is being accessed.
張貼留言

這個網誌中的熱門文章

解釋scope.$apply用來做什麼? -- AngularJS

Unions 在C語言的簡單介紹

JavaScript的Timer用法