The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Get The Current Domain Of A Web Page

TODO: Pull subtitle into page object
loading...

notes

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Get The Current Domain Of A Web Page

-- script
-- show

document.addEventListener("DOMContentLoaded", () => {
  const domain = window.location.origin
  exampleOutput.innerHTML = domain 
})

-- html
-- show: above

<div id="exampleOutput">loading...</div>


-- notes
-- title: notes

- "origin" is the proper word instead
of "domain", but I never remember that


-- ref
-- title: window: location property
-- subtitle: MDN
-- url: https://developer.mozilla.org/en-US/docs/Web/API/Window/location

-- ref
-- title: Location object
-- subtitle: MDN
-- url: https://developer.mozilla.org/en-US/docs/Web/API/Location


-- categories
-- JavaScript 

-- metadata
-- date: 2023-08-21 18:59:45
-- id: 2ujxihmf
-- site: aws
-- type: snippet 
-- status: published