Embedding Other Site in Anvil App Iframe?

So is there the ability at all to maybe embed another site into my anvil app? Example use case is I have the Material UI setup and one of the links either on the side or when you say click a morph name brings up a new form page that is basically another website with the call of the URL of that site to embedd in the app, is something like this possible at all?

Otherwise I guess I would have to scrape the site and use the data in my own forms and put a powered by the site I’m pulling from so to give credit, I don’t see any TOS on their site for what its worth either.

Thanks

Are you okay with the site simply opening in a new browser tab? You can use custom HTML and add target="_blank" to a hyperlink to have it open in a new tab.

<a href="https://www.hyperlink.com/" target="_blank">Here is a link </a>

I guess I was hoping for it to stay maybe inside the app itself that I’m making since I’m using the material UI look I guess I will have to play with the different options and see.

Have you tried using an iframe inside an HTML form?

https://anvil.works/ide#clone:A3NS4NH57FZHVWLB=SWK7PYVIJOWU3SXIK4NXHE3Z

1 Like

Is there a way I could build this iframe url dynamically? I have the URL I can make from selecting 2 snakes from a drop down menu I have then I want to display the results in a iframe on the page but I would have to be able to change this URL in the iframe dynamically and not show it until after the submit button is selected, etc.

Is that doable at all or should I just build my own look and stuff from the data from the site?

1 Like

I would try using a JavaScript function to select your iframe using JQuery and set its src property that way.

https://anvil.works/doc/#-div-id-js_interop-using-javascript-with-anvil-div-

1 Like

it also appears this site doesn’t support loading iframes because it doesn’t load when I try to use it in this clone of your app.

Dear Shaun,
I am running into a similar issue: trying to change the url of an Iframe object while the app is running. I cannot get a clear explanation of how to do this form the link you provided. It is too general. Please provide a more detailed description. Thanks in advance.