You are currently viewing the BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
I have a question regarding resolution of property names on global object (window object in case of browser hosting environment).
Lets say we have a global variable with the same name as property of a window object.
Code:
var location = "Test";
Global variable is in fact a property of global object (window). So having declared global variable location we cannot access original window.location property anymore.
As far as I know there is no way to access original property of window in this case but maybe someone has a clue?
Interestingly enough it seems that in Firefox window’s property takes precedence over global variable of the same name and for example var location = "Test.html" changes current location.