[Gambas-user] WebView.HTML does not show that instead WebView.Url shows.

Bruce bbruen at ...2308...
Mon Feb 25 05:44:23 CET 2013


On Sun, 2013-02-24 at 17:49 +0100, vuott at ...152... wrote:
> Hello,
> 
> I have noticed that not all the HTML code works with WebView.HTML. So, in this cases I must use  WebView.Url property.
> 
> 
> Example, if this HTML code:
> 
>   <HTML>
> 
>     <audio controls=controls autoplay
>        src="my_file_audio">
>  
>     </audio>
> 
>   </html>
> 
> 
> it doesn't work if I write:
> 
>   WebView1.HTML = "<audio controls = controls autoplay src =\"my_file_audio\">"
> 
> but it works, if I write it in a "html file", and then I re-call it with WebView.Url.
> 
> Why ?
> 
> regards
> vuott

Hi vuott,

Sorry it took time to get to an answer for you.

If I understand you correctly, you are trying to directly modify the
html text of a WebView object.  I think that the Webview object (a
"browser" does not allow this approach, even though it may be hinted at
in the help.) The WebView1.HTML should be thought of as a read only
property.

You need to read "Using WebView as an HTML editor" in the help pages.

Think of it this way:  The webview object is a browser not an html file
editor.  It's the same as modifying the html source in firefox's View
Page Source directly and expecting it to update the rendered page.  If
think on that you will see that what you have written in your original
post is correct! You can change the html code in a file copy of
webview.html and reload that file via WebView.URL but you cannot write
directly to webview.html.

hth
Bruce






More information about the User mailing list