Skip to content
Advertisement

Tag: window

Close Popup Before Opening Popup

I am attempting to improve an old calendar page I built using free “internet code” nearly 15 years ago. When the seven-column by six-row calendar displays, moving the mouse cursor over any one of the days displayed shows a “More Info” link, and clicking that link pops up a new window. The effective JS code: url looks like ‘2022-11-27.html’ ‘striing’

Get viewport/window height in ReactJS

How do I get the viewport height in ReactJS? In normal JavaScript I use but using ReactJS, I’m not sure how to get this information. My understanding is that only works for components created. However this is not the case for the document or body element, which could give me height of the window. Answer Set the props viewport height

Benefit of using ‘window’ prefix in javascript

Are there any benefits to using the ‘window’ prefix when calling javascript variables or methods in the window object? For example, would calling ‘window.alert’ have an advantage over simply calling ‘alert’? I can imagine using the prefix could give a small performance boost when the call is made from inside some function/object, however I rarely see this in people’s code.

Advertisement