Am trying to get the alt value from an image map by using the "saveHTML WebViewExtras" sample project.
In Main.b4a:
I've read http://www.b4x.com/forum/additional...al-updates/12453-webviewextras.html#post70053 for details of the second parameter callUIThread, and many other articles.
:banghead
B4X:
In the HTML:
<map name="pn13">
<!-- #$-:Image map file created by GIMP Image Map plug-in -->
<!-- #$-:GIMP Image Map plug-in by Maurits Rijk -->
<!-- #$-:Please do not edit lines starting with "#$" -->
<!-- #$VERSION:2.3 -->
<!-- #$AUTHOR:oper8or -->
<area id=1 shape="rect" coords="134,1,188,28" onclick="openNav(this)" alt="1" target="pn" href="" />
<area id=2 shape="rect" coords="134,56,188,83" onclick="openNav(this)" alt="2" href="" />
<area id=3 shape="rect" coords="231,102,285,132" onclick="openNav(this)" alt="3" href="" />
</map>
<script>
function openNav(element) {
var alt = element.getAttribute("alt");
document.getElementById("tname").innerHTML = alt; <!-- How does this happen? -->
}
</script>
B4X:
Sub WebView1_PageFinished (Url As String)
Dim Javascript As String
'Javascript="B4A.CallSub('ProcessHTML', false, document.documentElement.outerHTML)"
Javascript="B4A.CallSub('ProcessHTML', false, document.documentElement.innerHTML)"
Log("PageFinished: "&Javascript)
WebViewExtras1.executeJavascript(WebView1, Javascript)
End Sub
:banghead