HTML SDK

Make a [Linket] on an HTML5 page


Below is a working linket named [Flowers].


To create this button we need to create an HTML element and attach a click event listener to it. For simplicity, we use the button element and give it the identifier ‘linketbutton’. You can, however, use other HTML elements. Furthermore, if you have a page of linkets, this can be done using the classname.


The code of a button used for a linket looks like this:

<button id="linketButton" >[Flowers]</button>


The Javascript code to operate the [ Linket ] uses the HTML5 fetch method which is available in all web browsers. You can read more about it here: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch. The code to operate this linket is below.



window.addEventListener('DOMContentLoaded', (event) => {
            document.getElementById('linketButton').addEventListener("click", function(){
fetch("https://e18inyvxpe.execute-api.us-east-1.amazonaws.com/linket_backend?command=getLinket&linket= "[Flowers]")
	.then(response => response.json())
        .then(json => window.location.href= json[0].value.appid )
	.catch(err => console.log(err));}
, false);
        });


Congratulations, Enjoy Your New [ Linket ] !


For HTML5 Sample code, visit the Github Repository