Load HTML content without external resources into an iframe - html

How can I only load the HTML of a page into an <iframe>, without automatically triggering the download of all the CSS, scripts, images and videos on the page?

In short: you cannot. Much like you cannot "load an HTML page in a browser" without making the browser load all the linked resources (images, stylesheets). It's up to the browser how it implements its iframes, but most browsers treat them like embedded separate websites that are treated just like ordinary websites in terms of loading linked resources.
What is it you are actually trying to do?

Related

How to embed a website in another website?

I have two websites, and I want to embed one in the other. I am aware that I can do this using either iframe or embed, but both only embed the webpage, not the entire website. I want it so that a user can click buttons, navigate, etc. throughout the site, accessing different URLs.
An iframe can indeed do that. Navigation inside the iframe does not affect the embedding webpage.

How to prevent users to access embedded video files in an intranet?

I need to publish an HTML page in an intranet containing the index of some video files, also located on the network. From the main page I thought of pointing, for each video, to a separate html page in which to incorporate it.
I would like to know if it is possible to prevent users from accessing video files directly by browsing the network resources. In practice, the videos should be visible only through the html pages but the relative .mp4 files should not be accessible in any other way (for example by making copy and paste via file explorer). Is it technically possible?
Finally, to prevent download from html pages I thought deactivating the right button on the embedded videos also if it's not the solution for all browsers.

embed pdf in html: difference between gview and simple iframe

in this video they recommend using an iframe that calls the GView (google viewer). Is it of any use? Can't you simply reference the pdf in the iframe? what's the benefit of adding the GView?
https://www.youtube.com/watch?v=visxQbQIySg
Most of browsers are expected to manipulate standard web extension such HTML,CSS,JS etc. however they may optionaly support non-web extension (as well as PDF,SWF etc.).
If you push a PDF directly to the browser and the browser does not support PDF extension the file will be downloaded and no defference if you push it inisde an iframe. When you use GView or other Document Viewers they convert the target file to HTML tags or other supported formats for all browsers (like canvas) and so you make sure that the file will be displayed on screen rather than being downloaded. Also they have extra tools like zooming, paging etc. that improves the user experience.

When we use Iframe to load another website what happen to data usage?

I am developing website by using ASP.net
In there I have a page where I use a iframe to load another website inside my website. Lets say I am opening WWE.com, Youtube.com inside the iframe. When we normally surf these websites it will take while to load these.
So when I do that will the bandwidth will be serve from my website/Server? or theirs?
When you are using iframe, the clients bandwidth will be consumed.

Use of Iframe or Object tag to embed web pages in another

In a web-based system I maintain at work that recently went live, it makes an Object element to embed a second web page within the main web page. (Effectively the main web page contains the menu and header, and the main application pages are in the object)
For example
<object id="contentarea" standby="loading data, please wait..."
title="loading data, please wait..." width="100%" height="53%"
type="text/html" data="MainPage.aspx"></object>
Older versions of this application use an IFRAME to do this though. I have found that by using the object tag the embedded web page behaves differently to when it was previously hosted in an IFRAME. In IE, for example, the tool tips don't seen to work (I will post a separate question about this!), and it looks like the embedded page cannot access the parent page in script, although it can if it was an IFRAME.
I am told the reason for favouring the object tag over the IFRAME is that the IFRAME is being deprecated and so cannot be relied on for future versions of browsers. Is this true though? Is it preferable to use the Object tag over the Iframe to embed web pages? Or is it likely that the IFRAME will be well-supported into the future (long after I am old and grey, and past the useful life of the application I maintain)?
The IFRAME element is part of the upcoming HTML5 standard. Also, HTML5 is developed by the major browser vendors out there (Mozilla, Opera, Safari, IE), that basically makes a guarantee that we will have an IFRAME element in the foreseeable future. Some of them have support for some HTML5 elements already, like AUDIO and VIDEO and some new JavaScript APIs.
It's also true that the OBJECT element is in the draft, but that's because IFRAME and OBJECT will have different purposes. IFRAMES are mainly designed for sandboxing web applications.
So, my advise is to use IFRAME instead of OBJECT.
If you are embedding a HTML page, here is one noticeable difference between iframe and object:
with iframe updating src will change the browser history (adding a new entry)
with object updating data will not change the browser history
Also it seems like drag&drop does not work if the page is embedded in the object tag, but works in the iframe tag. I noticed it personally using react-draggable, and I can see someone had the same issue (https://stackoverflow.com/questions/31807848/replacing-iframe-with-object-tag-drag-and-drop-not-working)
IFRAMEs are not part of the XHTML 1.0 Strict DTD. They are totally valid in in HTML 4 and XHTML 1.0 Transitional, I believe. For these reasons alone, IFRAME will continue to be supported for a long time.
A lot of bookmarklets and analytics code still use IFRAMEs.
Although the W3C specs may indicate that the IFRAME tag is being deprecated, (in XHTML at least anyway), browser developers do not necessarily follow exactly what those specs say (IE6 anyone?)
As use of IFRAMEs is so prevalent at the moment, and the W3C can't seem to decide if they are part of the future or not (HTML 4.01 vs XHTML), I am pretty sure they are the safer implementation to use for almost every browser.