Because window
is the global object, you can call an alert
either by it’s shorthand: alert( 'Hello!' );
or by referencing the global object specifically: window.alert( 'Hello!' );
They are the same.
More Related Contents:
- How to make page loaders/animations/transitions
- What is the purpose of a self executing function in javascript?
- How do I iterate over a JSON structure? [duplicate]
- How can I read the client’s machine/computer name from the browser?
- How to build PDF file from binary string returned from a web-service using javascript
- JSON datetime between Python and JavaScript
- What’s the difference between window.location= and window.location.replace()?
- Is there an equivalent of the __noSuchMethod__ feature for properties, or a way to implement it in JS?
- How do I add an “Add to Favorites” button or link on my website?
- How to check in Javascript if one element is contained within another
- Completely removing duplicate items from an array
- Export javascript data to CSV file without server interaction
- How to make a browser display a “save as dialog” so the user can save the content of a string to a file on his system?
- replace all occurrences in a string [duplicate]
- How do I split a string into an array of characters? [duplicate]
- What Javascript Template Engines you recommend? [closed]
- How can I make event.srcElement work in Firefox and what does it mean?
- HTML comments in a javascript block?
- Have just one InfoWindow open in Google Maps API v3
- How to move table row in jQuery?
- querySelector search immediate children [duplicate]
- How to make one Observable sequence wait for another to complete before emitting?
- How can I see the source of built-in JavaScript functions? [closed]
- The most accurate way to check JS object’s type?
- how to get session id of socket.io client in Client
- How do you swap DIVs on mouseover (jQuery)?
- how to update time regularly?
- Validate phone number using angular js
- getting last page URL from history object – cross browser?
- Cross-domain XMLHttpRequest using background pages