2009/8/1 João Eiras <joaoe@opera.com>: >> >> >> How can one in a script check for UA support? >> else if(localStorage){} >> does not work for Opera**. > > Hi. > This obviously does not work because you need to prefix localStorage with > window "if(window.localStorage)" else the script breaks because localStorage > is a undefined identifier while window.localStorage looks up a property in > the window. Different things, specific to ecmascript itself. No, the window object is the global object where all global variables are defined. Try the following: <script> a = 10; alert(window.a); </script> / JonasReceived on Thursday, 6 August 2009 04:43:24 GMT
This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:33 GMT