Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I would guess the code was run 2 times and the first time only silently. I dunno why.
-
jsmrcaga7808yActually it is an intended feature of the js console (but if the variables are init at runtime its definitely a bug) try it in chrome and call a non-declared variable which coincides with rhe id of an element ;) its supposed to save you time when debugging
-
@jsmrcaga Google maps didnt work on a customers Site in Safari, I don't think it's a Feature :D searched for a while to find this :/
-
Didn't you hear? Apple decided it would be easier to just use "var test" instead of "document.getElementById('test')"
The rest of the browsers will follow -
Rocket3G2008yIt's not just safari that's doing it. I believe both chrome and edge behave in the same manner. Not sure if it happens when initializing it with car though.
-
@Rocket3G Google maps didn't work on safari but worked on chrome for us, this was the reason, so in chrome this shouldn't happen 👍
-
jsmrcaga7808y@FirePanther, in chrome i have experienced the same thing, however the variable which holds the element (and is named as its id) is only initialized when called and being undefined. But if they are initialized when parsing html, or declaring with var (which seems to.be the problem with safari) its quite a problem, since a lot of mac people dont even bother downloading another browser...
Related Rants
This Safari Bug is sooo bad, really hard to find it. (It initializes new variables with the element where id and variable name is the same, why?)
undefined
bug
safari