[COW] JavaScript define PHP like function
This time my personal COW is a quite totally cross browser function to define a JavaScript constant. With FireFox or Safari a const variable should be nested or global but the most important thing, it cannot be assigned two times const scriptCantChangeMe = "some text"; scriptCantChangeMe = "something else"; alert(scriptCantChangeMe); // some text A constant should be every kind of JavaScript variable and if this feature will be available on future versions of Internet Explorer and Opera, a lot of security problems should be solved (think for example about JSON, Array, Object and every other constructor, method or callback). Unlikely We can't use this feature with Opera browser and, quite more important, Internet Explorer doesn't support JavaScript constants. The only way to create a global scope constant variable with Internet Explorer is using another language: VBScript This IE dedicated language supports PHP like defined constants: scalar values like int...