Buradasın
JavaScript window.location.href Usage
tutorialscollection.com/faq/window-location-href-how-to-use-location-href-property-with-examples/Yapay zekadan makale özeti
- Property Overview
- Href property retrieves complete URL of current web page
- Can be used to set or get URL of current page
- URL can be absolute or relative to other files
- Usage Methods
- Can be accessed using window.location.href or location.href
- URL can be set using window.location.href = "URL"
- Relative paths can be used within current domain
- Examples
- Three examples demonstrate getting current URL
- Same result obtained using both window.location.href and location.href
- Another example shows setting URL to google.com
- All examples include button for URL retrieval