回复:Re: [wxPython-users] what is different betw een webview.LoadURL and webview.SetPage

<[email protected]>
Newsgroups gmane.comp.python.wxpython
Message-ID <[email protected]>
I found if we use SetPage:
<script type="text/javascript" src="xxx.js"></script>is not imported.So. what is the best way to render a text in memory?one way is open an server, then use the LoadURL. Is there some easy method?
----- 原始邮件 -----
发件人:Scott Talbert <[email protected]>
收件人:wxpython-users <[email protected]>
主题:Re: [wxPython-users] what is different between webview.LoadURL and webview.SetPage
日期:2020年01月29日 00点48分


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.

-- 
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/20200129132226.3CB94414009D%40webmail.sinamail.sina.com.cn.
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.