Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
22nd May 2021, 3:53 PM
Cmurio
Cmurio - avatar
+ 3
iframe could embed any html document... as soon as the html document belong to the same origin as the hosting page or the target allow for CORS (cross origin requesrs) ^^ iframe first purpose is to embed sub part of a site, such as menu, header, footer... to avoid repeating same code through many pages (and querying only for the content subpart when navigating). iframe second purpose is to embed another site content, such as youtube video player or advertisments . finally, iframe could be used to load js code only once, and having it accessible from another iframe (wich could be navigated independently -- without unloading javascript) and used from there... or to store some values access pages (without size limitations such as cookies or sessionStorage) during one user session, or even to do computation without interruption due to navigation ;P
22nd May 2021, 5:48 PM
visph
visph - avatar