diff --git a/src/content/writings/2023-11-21-without-js.mdx b/src/content/writings/2023-12-12-links-buttons-javascript.mdx similarity index 69% rename from src/content/writings/2023-11-21-without-js.mdx rename to src/content/writings/2023-12-12-links-buttons-javascript.mdx index f4e98d7..bcb1614 100644 --- a/src/content/writings/2023-11-21-without-js.mdx +++ b/src/content/writings/2023-12-12-links-buttons-javascript.mdx @@ -1,15 +1,15 @@ --- -title: If you could not use JavaScript -pubDate: 2023-11-21 +title: Links and buttons and JavaScript, oh my! +pubDate: 2023-12-12 description: "How you use links or buttons primarily depends on the need for user input and the intended default browser behavior." draft: true --- import CodeFigure from "@components/CodeFigure.astro"; -The software teams I have worked with over the last 10 years have primarily developed single-page applications (SPA). That is a long time to practice and learn from that pattern. Two years ago, I published the article [*Warning signs of front-end complexity*](/2022-08-30/complexity) as a way to reflect on the problems encountered with this approach and to provide a way forward. Since then, I directed two software teams on migrating their single-page architecture to a multi-page architecture. +The software teams I have worked with over the last 10 years have primarily developed single-page applications (SPA). Last year, I published the article [*Warning signs of front-end complexity*](/2022-08-30/complexity) as a way to reflect on the problems encountered with this approach and to provide a way forward. Since then, I directed two software teams on migrating their single-page architecture to a multi-page architecture. -During these projects, developers frequently ask me about the user interface: +When relying on client-side routing for so long, it can be easy to forget how else to do it. As such, developers have asked me during these architecture migrations: > Should this be a link or a button? @@ -17,7 +17,7 @@ My most effective response is simply: > How would you build this if you could not use JavaScript? -A JavaScript-less web relies on links and form submissions to handle all interactions with the server, resulting in a page refresh or redirect. Let's review some examples: +A JavaScript-less web relies on links and form submissions to handle all interactions with the server, resulting in a page redirect to the same or a different page. There are also ways to use links and buttons that do not involve the server. Let's review some examples: - [Links](#links) - [In-page links](#in-page-links) @@ -116,7 +116,7 @@ Use in-page links with `#` in the `href` value to navigate to specific content o ``` - + ```html