Page 1 of 1

Calling a JavaScript function in the browser control from LC

Posted: Wed Apr 25, 2012 12:35 am
by BarrySumpter

Code: Select all

<html>
<head>
<script type="text/javascript">


function myfunction(txt)
{
alert(txt);
}



function myfunction2()
{
alert('Who Dat Be?');
}


</script>
</head>
<body>

<form>
<input type="button" onclick="myfunction('Hello')" value="Call function">
</form>

<p>By pressing the button above, a function will be called with "Hello" as a parameter. The function will alert the parameter.</p>

</body>
</html>

Code: Select all


on doCallBrowserFunction
   
   MobileControlDo sBrowserId, "execute", "myfunction('sup dude!')"  
   MobileControlDo sBrowserId, "execute", "myfunction2()"    
   
end doCallBrowserFunction