Avatar of JimHubbard
JimHubbard
Flag for United States of America asked on

iframe scrolling in html5?

I want to include a page from another website in a page on my site.  But, the page that I want to include will probably not be the same size (or even fit completely in) the iframe container that I wanted to use (especially if the web page containing the iframe has been resized to be even smaller).

I am new to web coding, but I have seen that there may be an issue with scrolling in an iframe when using HTML5.  I have seen sites saying that this s broken, but nothing that gives coded examples of howto work around the issue.

If the page that I want to embed is larger than the area of the iframe, what is the best way to embed the other site's webpage in my page using HTML5 and CSS3 (jQuery and PHP 5 will also be used - just in case that makes any difference).

I do have access to the site code for the site page that I will be embedding.  Should I just code the originating page to read the size of its container and refresh accordingly?  If so, do you have any code samples of how this is done?
HTMLWeb Development

Avatar of undefined
Last Comment
JimHubbard

8/22/2022 - Mon
COBOLdinosaur

cross browser scripting will always fail because it is a security violation.  Sroling the iframe on your page should not be a problem, but without seeing the HTML it is impossible to know if you have an error that is preventing it.

Cd&
SOLUTION
Amar Bardoliwala

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
JimHubbard

ASKER
I have been informed that they (the site owners) would like for me to find a solution that does not include altering the primary site from which the catalog is coming.

Is there a way to do this without altering the main site by screen scraping or something?

The main site is an ecommerce site with a catalog and a search function that users can search the catalog for items containing the search terms.  The owners want to display the catalog (with search) on the new site, in an iframe that will resize with the page it is embedded in.

To make the task completely impossible, the two sites are on different servers located in different locations (one is their primary warehouse and the second is a specialty warehouse in another state) - so there goes just linking to the server locally.

And, no...they have not exposed an API from the main site.

Is this even possible?
SOLUTION
COBOLdinosaur

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
JimHubbard

ASKER
I don't think this is going to work - at least not the way they want it done.

Although I am a beginner at web coding, the problem here is that the owner's don't even know s much as me about web coding and are tying my hands by not allowing changes to the main site (like adding a page formatted for inclusion in iframes) or exposing an API.

I think I could show items from the catalog in an iframe by doing some screen scraping on the server - but I'd have to keep a window open to the server to pass through clicks and search info to an actual page and scrape, format and forward the results to the iframe.

Even if I could do the server/scrape thing, the amount of time involved will far exceed the amount of time that it should take to do it right (with an API or iframe formatted search page).

It may be time to tell the owners that it just cannot be done their way.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
ASKER CERTIFIED SOLUTION
COBOLdinosaur

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
JimHubbard

ASKER
Thanks for the help!