Nov 21, 2009
Pages: 1, 2

Juggling An Iframe Box With Xhtml Sites - How to make it strict and valid

free web hosting

Read Latest Entries..: (Post #11) by iGuest on Nov 1 2009, 07:31 PM.
Thanks for your help. For those who want to fix the IE problem, we might consider cheating an option: <object data="http://page.Html" type="application/xhtml+xml" style="width: 340px; height: 280px;">      <!--[if IE]>           <iframe src="http://page.Html" style="width:340px; height:280px;" allowtransparency="true" frameborder="0" ></iframe>  &n...
read more.
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

Open Discussion & Free Web Hosting > Computers & Tech > How-To's and Tutorials > Websites and Web Designing

Juggling An Iframe Box With Xhtml Sites - How to make it strict and valid

FirefoxRocks
You most likely have encountered a situation (as a web developer) where you have an iframe box and you are using valid XHTML Strict. Iframes are still valid in FRAMESET and TRANSITIONAL XHTML but it is best to use XHTML 1.0 Strict or XHTML 1.1 (application/xhtml-xml). A method for including iframes have been found. It doesn't use the <iframe> tag at all.

Since tags are depreciated, new tags/CSS are to replace them (except DOM, which is a little off topic here). The <applet> and <iframe> tags were replaced by <object>. Yes, <object> is for inserting any foreign object into XHTML documents.

Since IFRAMES include HTML/XHTML documents, the MIME type for the document is "text/html" or "application/xhtml+xml". We will assume the first one because it is compatible with ALL browsers including Internet Explorer. There is of course a way to serve the latter one to Mozilla-derivatives and Opera using PHP but I'll save that for another tutorial.

So you have your MIME type, URL source and <object> tag. Put it together with like this:
HTML
<object data="http://www.x-kings.com/public/banner/guild_short.php?name=XKingdom" type="text/html"></object>


A little more detail:
HTML
<object style="width:240px;height:70px" data="http://www.x-kings.com/public/banner/guild_short.php?name=XKingdom" type="text/html" standby="XKingdom Guild Information"></object>


A variety of attributes work with the <object> tag. The elements are:
  • align - Aligns the object. Use CSS instead.
  • archive - The URL for archived versions.
  • border - The border around the object. Use CSS instead.
  • classid - Defines a ClassID in the registry.
  • codebase - Defines where the code is for the object??
  • codetype - The MIME type for the code in the above 2 values??
  • data - The URL of the object (required).
  • height - Height of object. Use CSS instead.
  • hspace/vspace - Margins around the object. Use CSS instead.
  • name - The name of the object if you are using it in JavaScript/VBScript or some other scripting language.
  • standby - Text to display when loading
  • type - The MIME type of the object (explained above). Required.
  • width - Width of object. Use CSS instead.
Red attributes are depreciated. They will NOT validate on HTML 4.01 Strict, XHTML 1.0 Strict or XHTML 1.1.
Purple attributes MAY be incompatible with browsers. From personal experience, adding those attributes will only render it in Internet Explorer. We don't want that to happen.

All of these attributes + CSS is intended to replace all attributes of <iframe>. The only one I couldn't find easily was "scrolling" in <iframe>. Using CSS, the {overflow:scroll} thing works the same (haven't tested).

This is my first tutorial, sorry if I was a bit unclear about things.

 

 

 


Comment/Reply (w/o sign-up)

FeedBacker
Thank you! It couldn't be simpler and gets rid of all those errors in the W3C HTML Validator.

Thanks again,

Dan

Comment/Reply (w/o sign-up)

FeedBacker
Iframes are not supported in xhtml strict so use an object instead. Very helpful example Thanks! That's the answer that I was looking for =)

Comment/Reply (w/o sign-up)

FeedBacker
Hi and thank you so much for this clear and straightforward tutorial!

Unfortunately, it works perfectly in our beloved Firefox, but in IE and Safari it displays nothing :(

Any ideas, useful links, suggestions? Please help me :)

I can post the code, but I am not sure I can do it since this is not a forum :p

-Francesca

Comment/Reply (w/o sign-up)

toby
Not terribly related, but if you have a frames site within an object or frame on your site, can you control the innermost frame (changing url) from your site? Yoursite=(Theirsite=((target)) controls).

Comment/Reply (w/o sign-up)

FirefoxRocks
QUOTE(FeedBacker @ Feb 18 2008, 10:10 AM) *
Hi and thank you so much for this clear and straightforward tutorial!

Unfortunately, it works perfectly in our beloved Firefox, but in IE and Safari it displays nothing sad.gif

Any ideas, useful links, suggestions? Please help me smile.gif

I can post the code, but I am not sure I can do it since this is not a forum tongue.gif

-Francesca

Erm...as for IE, you can probably use a conditional comment for an <iframe>. It's a dirty trick as XHTML will parse it as a comment but it will still be rendered in IE (as only IE supports conditional comments).
It works for me in Safari, what version are you using? I tried it in Safari 3.0.4 Beta and Konqueror on Ubuntu and they both display the <object> as intended.

 

 

 


Comment/Reply (w/o sign-up)

FeedBacker
errata
Juggling An Iframe Box With Xhtml Sites

I can't believe that there is no attribute 'id'.

There is no 'I' in 'deprecated'.

Comment/Reply (w/o sign-up)

FeedBacker
Javascript with the Object Tag
Juggling An Iframe Box With Xhtml Sites

Replying to toby

Getting an HTML page embedded with the OBJECT tag to work in IE requires the addition of the CLASSID parameter

<object
classid="clsid:25336920-03F9-11CF-8FD0-00AA00686F13"
type="text/html"
...
</object>

Putting links in your page to change the displayed page in the OBJECT tag requires Javascript.

I have used:

Document.GetElementById('objectid').ContentDocument.Location = link;

With mixed success. It works once (clicking on the first link) but after that, contentDocument becomes read-only for reasons I do not yet understand.


-reply by Anonymous Coward

Comment/Reply (w/o sign-up)

FeedBacker
Google Calendar
Juggling An Iframe Box With Xhtml Sites

Thank you. It worked like a charm for Google Calendar!

-reply by Waner Del Rosario

Comment/Reply (w/o sign-up)

(G)Sientz
IE vs Firefox
Juggling An Iframe Box With Xhtml Sites

It worked for me also...Well at least in Firefox it works and it validates but in IE I just get an empty box. I saw some semi-complicated java script things to try and get around this but I couldn't really figure it out. It's called the Improved Satay Method... 
-question by Sientz

Comment/Reply (w/o sign-up)

Latest Entries

iGuest

Thanks for your help. For those who want to fix the IE problem, we might consider cheating an option:

<object data="http://page.Html" type="application/xhtml+xml" style="width: 340px; height: 280px;">

     <!--[if IE]>

          <iframe src="http://page.Html" style="width:340px; height:280px;" allowtransparency="true" frameborder="0" ></iframe>

     <![endif]--> 

</object>




Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Pages: 1, 2
Similar Topics

Keywords : juggling, iframe, box, xhtml, sites, make, strict, valid

  1. Content Sites And Mini Sites
    (1)
  2. Drop-right Menus With Pure CSS
    Just for educational purposes, not to be used for real sites (7)
    I am sure you've all encountered drop-down (not to say drop-right) menus. While these may seem
    pretty hard to make, it is actually extremely easy. Actually, it can get rather hard when using
    JavaScript, but this tutorial will show you how to create good-looking "pop up" menus opening to the
    right with pure CSS. However, I must warn you that this tutorial is more for educational purposes,
    then for use in real web sites. Why? Simply because the following method won't work properly in
    Internet Explorer (how unexpected..). I am sure this might as well work with seve....
  3. Xhtml Tutorial - Introduction
    XHTML Web Development Lesson 1 (0)
    This is a free lesson of XHTML provided by FirefoxRocks . After successfully
    completing your course of XHTML, you will be able to: Create a simple website Have valid XHTML to
    clean up the web Apply tags properly to minimize work What is HTML ? HTML is a language that is
    read by Internet browsers. It tells how browsers display the webpage. HTML files must have the .html
    extension, although very old pages do use the .htm extension. HTML stands for H yper T ext M
    arkup L anguage. You are probably using Internet Explorer right now. To view the HTML ....
  4. Php/xhtml Pages
    A simple guide to making valid PHP/XHTML pages (3)
    As you know, if you use the XML encoding tag, XHTML Doctype and the XML Namespace attribute in the
    html tag on a .php document, it won't render properly and will infact display errors. A
    solution to this problem is to use the require function of the PHP system. (I'm new at PHP,
    just learnt it yesterday, please feel free to correct anything /smile.gif"
    style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />) Here are some examples of
    pre-body text: Normal XHTML document pre-body information: CODE My XHTML Site
    ...style inf....
  5. Transparent Iframe Scrollbars ( For Internet Explorer )
    (5)
    Requirements Internet Explorer IFrames on your site Perhaps a little basic HTML knowledge
    Adding Iframes What are Iframes? Iframes is like an 'area' on a webpage where an
    external page is displaid. In other words it's where a webpage is show up in another page.
    How do I create an Iframe on my site? Step 1 Create two files named page1.htm and frame.htm .
    You can use Notepad (on Windows) to do this. Step 2 Open up page1.htm , and add the following
    HTML code: CODE Here is an Iframe: Edit 'NUMBER' with wha....
  6. Upgrading Your Site!
    Move from HTML 4.01 to XHTML 1.0 (0)
    I planned to post 3 different parts because of the length, but so there's no confusion, I'll
    just make one big tutorial all together /cool.gif" style="vertical-align:middle" emoid="B)"
    border="0" alt="cool.gif" /> . ====================================== (A note to the moderators:
    Alright, I've got this down now, so please delete all of my other posts besides this one, and
    any posting credits as well; thanks!) ====================================== Now the tutorial:
    Concerning those in the webmaster biz... If you are an aspiring experienced webmaster, the....

    1. Looking for juggling, iframe, box, xhtml, sites, make, strict, valid

See Also,

*SIMILAR VIDEOS*
Searching Video's for juggling, iframe, box, xhtml, sites, make, strict, valid
advertisement



Juggling An Iframe Box With Xhtml Sites - How to make it strict and valid

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com