Hi
I need to include other websites that arent hosted on my server, in my webpage.
Quite a long time ago I would do this using the iframe tag. Is this still a good approach? What would you guys do?
Advice appreciated
Hi
I need to include other websites that arent hosted on my server, in my webpage.
Quite a long time ago I would do this using the iframe tag. Is this still a good approach? What would you guys do?
Advice appreciated
Are these other sites your own sites (which by what you said they might not be owned by yourself) and do you have the relevant legal permission?
Iframes aren’t used much these except for under very special circumstances.
I would generally recommend just linking to the page.
If you do not host & own these websites and you need to display certain content the i-frame is the only way to go…
Hi Everyone thanks for getting back to me.
The company i work for requested this because they would like their distributors website in an iframe type approach but with the company’s header and footer.
HEADER
External website via iframe or alternative
FOOTER
As for permissions, well we stock their products as well as the other way round so it wont be an issue as we have a relationship to the companies that we will be linking to.
I know i can link to the websites directly but the company dont want this.
here’s a good tidbit on iframes vs. XMLHttpRequest that might help you with your decision.
Never use iframe. Not only is it bad practice but it will make your site just look old-fashioned.
you might be thinking of frames in general. Iframes are still in use today and are actually implemented on a lot of major sites.
I agree with Chris, do not use iFrames unless you absolutely have to. They’re old-fasioned. You could always use a simple PHP include a file in your page if it’s something simple. Hope this helps.
<?php include('includes/google.html'); ?>
I code in asp and not in php unfortunately. So i will look into it again as i did look into it and found that asp doesnt support cross browsing domain.
Thank you for your input everyone I really appreciate it!
‘doesnt support cross browsing domain’
I believe that is a security issue that’s standard but not 100% sure.
a good alternate of iframe is jquery load function
$('#divID').load('externalpage.html');
this method will load the external page html in a specific div. you will have the control on its styling and everything
Actually iframes are necessary for displaying widgets, ad frames and lot of stuff, but in your case, if you’ve got everything hosted with you, then you should definitely AVOID iframes.
They can also slowdown your site, and definitely they’re a big NO-NO, if you can help it!
I frames is also not good for seo.
If you have this code then why are you trying to add iframe? These are not good from search engine point of view because search engine can’t read iframe content, better you should avoid it!
its robert who is trying to use iframe, not me