Page 1 of 1

How do I load html?

PostPosted: Sat Mar 04, 2017 2:01 am
by kareed
Hi,
I am trying to load html and can't seem to get it to work. I am trying the code below and nothing shows up in the browser.
Code: Select all
    CefBrowser browser_;

    browser_ = client_.createBrowser(null, useOSR, isTransparent);
    browser_.loadURL("about:blank");
    browser_.loadString("<html><body>test text</body></html>", "http://abc.com");


Thanks

Re: How do I load html?

PostPosted: Sat Mar 04, 2017 2:31 am
by Czarek

Re: How do I load html?

PostPosted: Sat Mar 04, 2017 3:34 pm
by kareed
I tried multiple things with "data:text/html" and the browser still is blank. Any other ideas?

Thanks

Re: How do I load html?

PostPosted: Sun Mar 05, 2017 1:52 am
by Czarek
createBrowser("data:text/html,test", ...)

Don't use loadString. Either pass to createbrowser or loadurl.

Re: How do I load html?

PostPosted: Sun Mar 05, 2017 2:08 am
by kareed
Unfortunately I need to load html that is generated by my software not from a url. Do I need to create a new browser each time?

Thanks

Re: How do I load html?

PostPosted: Sun Mar 05, 2017 2:28 am
by kareed
My apologies, I didn't try the loadurl. This method worked great with loadurl.

Thanks for the help.

Re: How do I load html?

PostPosted: Sat Aug 10, 2019 2:42 am
by guich
Czarek wrote:createBrowser("data:text/html,test", ...)

Don't use loadString. Either pass to createbrowser or loadurl.


Hi

Works fine when passing to createBrowser but not with loadurl.

Where can i find the supported types for "data:" parameter? I didn't find in the sources.

thanks

Re: How do I load html?

PostPosted: Sat Aug 10, 2019 8:12 am
by Czarek