Seeking help with calling a specific JavaScript function in an ASP.NET page. The code for the function is as follows:
<script type="text/JavaScript">
function CalculateDistance (plat1, plon1, plat2, plon2)
{
try
{
:
:
var d = R * c;
return d;
}
catch (error)
{
alert(error);
}
}
</script>
I need to understand how to invoke this JavaScript function both on page load and button click events while capturing the return value, specifically the distance calculated based on four input parameters.
Your assistance would be greatly appreciated!
Best regards, Girish