Android Question Call JavaScript in WebView from B4A code

dZouL IT

Licensed User
Longtime User

Anybody knows how to call JavaScript in WebView (using AJWebKit library) from B4A code.

I would like to blink specific image as what the HTML code below does. The JavaScript will be call from pop-up panel in the same activity.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
var blinkImg = function (imgname, s) {
    clearTimeout(blinkImg['blinking' + imgname]);
    var obj = document.images[imgname];
    if (arguments[1] === 'blink') { = !(blinkImg[s + imgname] = !blinkImg[s + imgname])? '' : 'hidden';
        blinkImg['blinking' + imgname] = setTimeout(function(){blinkImg(imgname, s);}, 350);
    else {
        blinkImg['blink' + imgname] = false; = '';
<img name="blinker1" src="some.gif"><br>
<input type="button" onclick="blinkImg('blinker1', 'blink');" value="Blink">
<input type="button" onclick="blinkImg('blinker1', 'stop');" value="Stop">

Many thanks for help given.