Skip to content
This repository has been archived by the owner on Jun 3, 2019. It is now read-only.

Commit

Permalink
instructions for defaultElement
Browse files Browse the repository at this point in the history
  • Loading branch information
termermc committed Nov 4, 2018
1 parent fa96e62 commit 74f2bd2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,12 @@ Basically just loads pages without reloading the page.
Place all files in your website's root, and make sure all paths point to index.html.
Then, place all your webpages in pages/, and specify the routes for them in routes.ini.

By default, when a document is loaded, the element that gets replaced with the loaded content is the body. You can change which element gets its content replaced by setting `defaultElement` to a DOM element. For example, place the following code at the bottom of the document body to change the content of the first `<p>` element, instead of the `<body>` element.
```html
<script>
defaultElement = document.getElementsByTagName("p")[0];
</script>
```

## How lightweight is it?
A lot more lightweight than React.

0 comments on commit 74f2bd2

Please sign in to comment.