Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Client Side Includes on HTML pages

Previously, I had thought that the only way to get content from external URLs into your page, were to use an IFRAME or JavaScript to include it into your pages.

I've just learned of another way using the tag:

<object type="text/html" frameborder="0" data="http://Server/URL/"></object>

I have found some content online that confirms this ability, but it doesn't talk much about features such as Accessibility and SEO of the page.

UPDATE: I'm not looking for information on HOW to use this method, looking for information regarding what happens to my page when i use this method, such as:

  • Accessibility: will screenreaders still be able read my document as if the content was included via a server side include.
  • SEO: will google still be able to index this content?
  • JavaScript: I have seen some of the articles talk about still being able to use JS like this, but are there any security implications.

The bottom line, this is not a well know method, so there's not much available online (that I can find anyway), so I'm looking to see if anyone has had experience implementing this method. Thanks!

like image 552
Roy Rico Avatar asked Nov 06 '22 15:11

Roy Rico


2 Answers

I think the question linked in Pekka's comment should satisfy you.
Nonetheless you could consider XML data islands too.

like image 90
Knu Avatar answered Nov 12 '22 09:11

Knu


To screen readers, object elements are conditional content, so they are not rendered automatically and must have a fallback.

For SEO purposes, the spec says the object can be activated by clicking on some highlighted text, for example.

<P><OBJECT declare
        id="earth.declaration" 
        data="TheEarth.mpeg" 
        type="application/mpeg">
   The <STRONG>Earth</STRONG> as seen from space.
</OBJECT>
...later in the document...
<P>A neat <A href="#earth.declaration"> animation of The Earth!</A>

Object elements have the same security restrictions as iframes, so cross-domain JavaScript is not allowed, but exceptions have been found and fixed.

References

  • HTML 4.0 Appendix B, Section 4: Notes on helping search engines index your Web site
like image 33
Paul Sweatte Avatar answered Nov 12 '22 11:11

Paul Sweatte