Forum Moderators: coopster
I do not want to use this option because the varying page length of the feed causes all kinds of usability issues.
I tried SSI but this can apparently only include files already in the same root as my HTML page. Here the feed page is coming from another domain.
What other options do I have to seemlessly incorporate their PHP-feed?
Thanks for any help and tips!
it will really depend on what format it comes in, if it is an html page then you will need to frame it somehow.
If it is an RSS feed created by php then you will need to parse and display it, usually using xml parser functions.
there are a number of functions and libraries which may or may not be available to use for including, you can search fo rany of them at [php.net...]
include
require
fopen
fsockopen
curl libraries
xml libraries
then your standard frame or iframe solutions
sorry it isn't very specific there are many ways of doing this. Some of these functions may not be available on shared hosts.
It is not a rss-feed but many content pages that i recieve from the partner. To have my website's header and footer above and under the content they suggest iFrame-ing.
So this seems the only solution?! ... yuck, yuck and triple yuck...
The user will be browsing inside the iframe: url of my page stays the same, my page doesn't reload to top on every click inside the iframe...
=====QUOTE============
What started out to be a simple quest has ended in disappointment. All I wanted to do is solve the riddle of how to resize an iframe based on its content when that content is loaded from a page in another domain that cannot be modified in the source file. A client side approach seemed like the logical choice for efficiency but after several days of Internet browsing and trying many different conceptual approaches I am convinced that this cannot be done with any client side only technique.
The Problem - It ain't easy
The problem is embedded in the security design of the DOM. As Netscape puts it "... When loading a document from one origin, a script loaded from a different origin cannot get or set certain predefined properties of certain browser and HTML objects in a window or frame." And origin is pretty tightly defined as protocol://host[:port], somewhat loosely referred to as "the domain" (unless document.domain is used to set a value that is a suffix of the current domain). So even though the foreign (different origin) document is rendered in the iframe of the current document, it is still on the other side of the security barrier. By experimentation, the barrier is bi-directional.
And, as document object element properties are on the list of properties subject to origin check, the short version is that it cannot be done this way. Several posters have said this, too. I don't like absolute statements, but there it is.
The Concept - The Only Way?
The only way I have been able to achieve the goal is with a server side approach. Conceptually, with a php script running as [myserver.com...] and a user clicks on a link that specifies [myserver.com...]
Mainpage.php includes the javascript callback function resizeFrame(), html
====END QUOTE===========
And I'd not go anywhere near an iframe.
Are you sure that, as a user navigates the "imported" partner content, my header and footer will always be automatically added to EVERY content page?
If so, could someone please translate this solution into copy & pastable code? It's very frustrating to be looking at the solution without being able to implement it :(
I am sure many others would love to use this solution!