500+ ways to load Javascript in frontend
5 min readJul 6, 2024
There are 500 ways to load JS in frontend
Under the Hood
You know iHateReading is all about these types of content, the content that makes reading good and easy.
Sharing the 500 ways to reload the javascript in frontend.
The window object of the browser and class constructor provides 500+ ways to do so.
- location = location
- location = location.href
- location = window.location
- location = self.location
- location = window.location.href
- location = self.location.href
- location = location[‘href’]
- location = window[‘location’]
- location = window[‘location’].href
- location = window[‘location’][‘href’]
- location = window.location[‘href’]
- location = self[‘location’]
- location = self[‘location’].href
- location = self[‘location’][‘href’]
- location = self.location[‘href’]
- location.assign(location)
- location.replace(location)
- window.location.assign(location)