Calling a JavaScript function in the browser control from LC

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Calling a JavaScript function in the browser control from LC

Post by BarrySumpter » Wed Apr 25, 2012 12:35 am

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



All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Post Reply

Return to “Android Deployment”