PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, November 30, 2022

[FIXED] How to pass a string into an iframe python

 November 30, 2022     html, iframe, streamlit, url     No comments   

Issue

Basically I have a list of urls, I want to automatically pass into an iframe src, for it to process and view it. How to do that?

example :

urls_arr=['xyz.com','ybk.com']
 for i in urls_arr:
   st.markdown(<iframe src=i></iframe>)

basically i am running an app in streamlit and i am using it to embed power bi reports. the urls are actually the report embed urls.

example :

urls_arr=['xyz.com','ybk.com']
 for i in urls_arr:
   st.markdown(<iframe src=i></iframe>)

reports not opening


Solution

You should wrap the markdown in an f-string and add unsafe_allow_html=True. something like:

urls_arr=['xyz.com','ybk.com']
for i in urls_arr:
    st.markdown(f"<iframe src='{i}'></iframe>", unsafe_allow_html=True)


Answered By - Jamiu Shaibu
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing