Re: what is different between webview.LoadURL and webview.SetPage

Scott Talbert <[email protected]>
Newsgroups gmane.comp.python.wxpython
Message-ID <[email protected]>
On Wed, 29 Jan 2020, [email protected] wrote:

> I have a html text, there is <script> tag in it, and the script need load
> some out source.
> 
> if I save it as a xxx.htm, and use LoadURL(file:///xxxx.htm), we can get the
> result.
> but if I use SetPage, I get a blank page.
> 
> I saw the SetPage has 2 parameter, the second one is url, what should I
> give?
> does the SetPage method run the js as LoadURL?

SetPage() allows you to provide the HTML you want to be displayed as a 
string, or wx.InputStream.  The second parameter is for providing a base 
URL for resolving relative links.  See documentation for SetPage():
https://docs.wxpython.org/wx.html2.WebView.html?highlight=webview#wx.html2.WebView.SetPage

You probably just want to use LoadURL, but if you wanted to use SetPage(), 
you could load your page into a string and then pass that to SetPage().

Scott

-- 
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/alpine.DEB.2.21.2001281144560.3710%40bear.techie.net.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.