Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

iframe scrolling in html5?

Posted on 2012-03-19
7
Medium Priority
?
795 Views
Last Modified: 2012-03-19
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?
0
Comment
Question by:JimHubbard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 37737723
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&
0
 
LVL 11

Assisted Solution

by:Amar Bardoliwala
Amar Bardoliwala earned 664 total points
ID: 37737956
Hello JimHubbard,

See if following helps

http://stackoverflow.com/questions/153152/resizing-an-iframe-based-on-content

Thank you.

Amar Bardolwala
0
 

Author Comment

by:JimHubbard
ID: 37738410
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?
0
Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

 
LVL 53

Assisted Solution

by:COBOLdinosaur
COBOLdinosaur earned 1336 total points
ID: 37738571
A web cannot interact with a page from another domain. Screen scraping may let you display the contents but you will not have the functionality. your problem can be summed up in one word SECURITY browsers and operating systems have restriction that are absolute when it comes to cross-domain access.

AFAIK there is no workaround... hackers would be on it in a second.  Before the restrictions were added cross-domain exploits were the most common method of delivering virus code, trojans, and server crushing bombs.  I don't think you are going to be able to please your bosses.  

Your best hope is to transfer the pages with a server to server HTTP request that then allows you to server the pages from the local server, but any thing embedded like js file could still be an issue.


Cd&

Cd&
0
 

Author Comment

by:JimHubbard
ID: 37738791
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.
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 1336 total points
ID: 37739036
The hardest part of web development is telling the boss or client that what they want is not possible.  However you have what you need most...alternatives.  So at least you don't not have to say NO!  Instead you can say "it is only possible if...".

Cd&
0
 

Author Closing Comment

by:JimHubbard
ID: 37739090
Thanks for the help!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question