1.4.0 • Published 10 months ago

@lyonfinancial/loan-calculator v1.4.0

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

lyon-financial-loan-calculator

image

A loader script to inject a loan-calculator component automatically

Usage on any website

  1. Inject the loading script in the head (ideally) of the website
<head>
    <title>My Website</title>
+   <script src="https://unpkg.com/@lyonfinancial/loan-calculator/dist/loader.js" />
</head>
  1. Create a div with an id of your choice where you want to display the calculator
    <p>Some existing content.</p>
+   <div id="loan-calculator"></div>
    <p>Some other existing content.</p>
  1. Initialize the loader as follows (ideally near the end of the body)
        <p>Some existing content</p>
+       <script type="text/javascript">
+        document.addEventListener("DOMContentLoaded", () => {
+            const loader = new LoanCalculator("#loan-calculator");
+            loader.load();
+        });
+    </script>
    </body>

Full change example:

<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>My Website</title>
+        <script src="loader.js" defer></script>
    </head>
    <body>
        <header>My Website</header>
        <nav>
            <a href="#">Home</a>
            <a href="#">About</a>
        </nav>
        <main>
            <div class="pane">
                <h2>Pane 1</h2>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
            </div>
            <div class="pane">
+                <div id="loan-calculator"></div>
            </div>
        </main>
        <footer>
            <p>Copyright ...</p>
        </footer>
+       <script type="text/javascript">
+        document.addEventListener("DOMContentLoaded", () => {
+            const loader = new LoanCalculator("#loan-calculator");
+            loader.load();
+        });
+    </script>
    </body>
</html>
1.4.0

10 months ago

1.4.0-beta0001

10 months ago

1.3.3

10 months ago

1.3.3-beta0001

10 months ago

1.3.2

11 months ago

1.3.2-beta0001

11 months ago

1.3.1

12 months ago

1.3.1-beta0001

12 months ago

1.3.0

12 months ago

1.3.0-beta0001

12 months ago

1.2.0

12 months ago

1.2.0-beta0001

12 months ago

1.1.0

1 year ago

1.1.0-beta0001

1 year ago

1.0.2

1 year ago

1.0.2-beta0001

1 year ago

1.0.1

1 year ago

1.0.1-beta0001

1 year ago

1.0.0

1 year ago

1.0.0-beta0004

1 year ago

1.0.0-beta0003

1 year ago

1.0.0-beta0002

1 year ago

1.0.0-beta0001

1 year ago