Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is there any creative way to populate html directly from a URL?

I am not trying to avoid using code (JS etc) here, but to build a certain tool.

Say I have a url string like domain.com/somthing, and this URL can return a single string like "John", or maybe a JSON, according to my design.

Is there any way today using html/CSS alone, to populate html elements, using the respond from this url directly without code?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

This for example is not possible: <input value='domain.com/somthing' type="text"> even if the url will return a pure string like "John".

Is this maybe possible using CSS or developers must use code ?

>Solution :

The iframe element can display another resource embedded in the current page.

<iframe src="//example.com/"></iframe>

… but there is no HTML or CSS mechanism for setting an attribute value on an arbitrary element using a URL. You would need JS for that (e.g. fetch + DOM).

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading