cssiframeembedjustpy

JustPy, embed html page in iFrame


I wish to embed an html map within a JustPy generated web page. I get mangled output which I guess means there's a CSS or other clash. Any ideas to get this working will be gratefully received.

import justpy as jp

def map_page(request):
    wp = jp.WebPage()
    jp.Div(text='iFrame with map goes here...', a=wp)
    m = jp.Div(a=wp)
    m.inner_html = '<iframe src = "map.html"></iframe>'
    return wp

jp.justpy(map_page)
wp = jp.WebPage()

Solution

  • see http://ceur-ws-browser.bitplan.com/volume/400 for a working example:

    http://ceur-ws.org/Vol-400/ is embedded:

    Vol-400

          headerHtml=f"""{links}<h3>{volume.h1}</h3>
        <a href='{volume.url}'>{volume.acronym}<a>
        {volume.title}<br>
        {volume.desc}
        published: {volume.pubDate}
        submitted By: {volume.submittedBy}"""
                iframeHtml=f"""
                <iframe src='{volume.url}' style='min-height: calc(100%); width: calc(100%);'></iframe>"""
                self.volumeHeaderDiv.inner_html=headerHtml
                self.volumeDiv.inner_html=iframeHtml