<script src="./src/hook.js"></script>
<p id="product-name"></p> <p id="product-price"></p> <script> function test() { var name = document.getElementById('product-name'); var price = document.getElementById('product-price'); // Set up the hooks Hook.register('_PRODUCT_NAME', function (args) { return args + ' Test Category'; }); Hook.register('_PRODUCT_PRICE', function (args) { return args + 10; }); Hook.register('_PRODUCT_PRICE', function (args) { return args + 10; }); Hook.register('_PRODUCT_PRICE', function (args) { return args + 10; }); Hook.register('_PRODUCT_PRICE', function (args) { return args + 10; }); name.innerHTML = 'Product Name: ' + Hook.call('_PRODUCT_NAME', 'Test Product'); price.innerHTML = 'Product Price: $' + Hook.call('_PRODUCT_PRICE', 10); } test(); </script>
Product Name: Test Product Test Category
Product Price: $50