This isn’t a reference guide, programming tutorial or detailed overview. It’s a Javascript refresher, assuming you know another programming language and puts all the information in one place (just ctrl+f to find!). Javascript has nothing to do with Java, is dynamically typed and has **C-like syntax
i’ve a question… how can I print all obj property without know them
exist something like reflection???
I’m looking for a function like (php) print_r(obj)
var str = “Hello”; // local variable
str2 = “Hello World”; /* global */
While “var” is the correct way to define a variable in the local scope, in this case both “str” and “str2” will become properties of the “window” object, which is essentially JavaScript’s global scope. A function is the only way to create a new local scope in JS, so “var” is only useful inside functions (and all JS code should be inside a function to prevent polluting the global scope).
the redirect when JavaScript is disabled sounds like a pretty good idea, however I’ve heard before that meta redirects are viewed negatively by Google and other search engines. If you’re using PHP maybe you could do a redirect with that inside the noscript tag. (or whichever server side programming language you prefer.)
Nice to see such an article recently posted somewhere and up voted 6 years after it was originally published…