Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embed an External Page Without an Iframe?

Is there any way to embed an external web page without using an iframe? I have access to both sites, I just want the page that the content is embedded on to resize based on the content that is embedded (it will change over time, and be on multiple sites).

Thanks!

EDIT: I don't think any kind of AJAX would work because it's cross-site, and JavaScript doesn't let you load off-site content (as far as I'm aware).

like image 960
JacobTheDev Avatar asked Dec 08 '11 15:12

JacobTheDev


People also ask

What is the difference between iframe and embed?

EMBED is basically the same as IFRAME, only with fewer attributes. Formally, EMBED is an HTML 5 tag, but on several browsers it will also work for HTML 4.01, if you are using this. It just cannot be validated. As always HTML 5 is recommended for the pages.

Why you shouldn't use IFrames?

Iframes Bring Security Risks. If you create an iframe, your site becomes vulnerable to cross-site attacks. You may get a submittable malicious web form, phishing your users' personal data. A malicious user can run a plug-in.

How do I display a web page on another page?

You could use an <iframe> in order to display an external webpage within your webpage. Just place the url of the webpage that you want to display inside the quotes of the src attribute. Show activity on this post. Either you use an iframe or you load the site via AJAX into a div (e.g. using jQuerys load() method).


2 Answers

You could load the external page with jquery:

 <script>$("#testLoad").load("http://www.somesite.com/somepage.html");</script> <div id="testLoad"></div> //would this help 
like image 189
Sudhir Bastakoti Avatar answered Sep 23 '22 03:09

Sudhir Bastakoti


Or you could use the object tag:

http://jsfiddle.net/7MaXx/

<!--[if IE]> <object classid="clsid:25336920-03F9-11CF-8FD0-00AA00686F13" data="http://www.google.be"> <p>backup content</p> </object> <![endif]-->  <!--[if !IE]> <--> <object type="text/html" data="http://www.flickr.com" style="width:100%; height:100%"> <p>backup content</p> </object> <!--> <![endif]--> 
like image 31
ptriek Avatar answered Sep 20 '22 03:09

ptriek