pls what script code do i write to join the function on my webpage to that of my smart contract to acheive the same result   