Android Question LoadHtml and LoadUrl

watesoft

Active Member
Licensed User
Longtime User
JS in webview:
Dim str As String=""
str = "Some Html statements" & "<script language='javascript' src='lang.js'></script>"     'lang.js is a js file in xui.DefaultFolder.
dim wv as  webview
File.WriteString(xui.DefaultFolder, "h1.html", str)
wv.LoadUrl($"${xui.FileUri(xui.DefaultFolder, "h1.html")}"$)

When I use the above code, it is ok and the function in Js file can execute.
But it can't execute when I LoadHtml(str) directly.
What's the problem?
 
Last edited:

PaulMeuris

Active Member
Licensed User
The contents of the lang.js file needs to be available in the string.
Concatenate it with the html string.
You could use a stringbuilder object.
 
Upvote 0
Top