How about:
window.location.hostname
The location
object actually has a number of attributes referring to different parts of the URL
More Related Contents:
- How to receive and maintain values in functions (javascript)
- How to add class to div based on radio button selected in it?
- Is it possible to import modules from all files in a directory, using a wildcard?
- Chrome doesn’t delete session cookies
- Why does typeof NaN return ‘number’?
- How can I communicate between related react components?
- How to count the number of occurrences of each item in an array? [duplicate]
- How do I check if string contains substring? [duplicate]
- Using AJAX to read local files
- How to access custom attributes from event object in React?
- jQuery single selector vs .find()
- RxJS Promise Composition (passing data)
- ASP.NET MVC Bundle not rendering script files on staging server. It works on development server
- JSON.stringify function
- Gulp.js task, return on src?
- Break on a change of variable value
- Changing the type in IE with JavaScript
- Colon after function declaration in javascript [duplicate]
- Why scripts at the end of body tag
- What is the advantage of initializing multiple javascript variables with the same var keyword?
- What is useState() in React?
- Difference between import X and import * as X in node.js (ES6 / Babel)?
- Countdown timer using Moment js
- Javascript array length incorrect on array of objects
- Preloading @font-face fonts?
- Get all elements in the body tag using pure javascript
- JavaScript remove ZERO WIDTH SPACE (unicode 8203) from string
- Google Maps API v3 Highlight Country Border without using Polygons
- How to make javascript fetch synchronous?
- jQuery JSONP ajax, authentication header not being set