Something goes wrong because the image not shows on screen, only the title and the word Bild!
How to solve this problem? Perhaps I use wrong methods?
I Try this code below build on the B4J-Server example.
Private Sub WebSocket_Connected (WebSocket1 As WebSocket)
ws = WebSocket1
Dim m As Map
Dim base As String = File.ReadString(File.DirAssets, "Dynamic.html")
Dim sHtm As String
m.Initialize
'm.Put("ImageID",File.GetUri(File.DirApp , "viewcamper.png")) ' no diffrent
m.Put("ImageID",File.DirApp & "/viewcamper.png")
sHtm = WebUtils.ReplaceMap(base, m)
Log (sHtm)
This is the content in Dynamic.html < p><img align="middle" alt="Bild" src="$ImageID$" style="width: 900px; margin-right: 0px;" /></p>
If I replace $ImageID$ on above html statement with the pathname to the picture en double click on Dynamic.html file, I can see the image on screen.
I thought code: MainDiv.SetHtml(sHtm) had the same function as that.
I'm going to test your suggestion above!
Thanks again!
I solved it!
The solution was to change m.Put("ImageID",File.DirApp & "/viewcamper.png")
to m.Put("ImageID", "viewcamper.png"). I discover it's important that the image and html-file
is placed on same directory!