Jump to content



Welcome to AstaHost - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!

Toggle shoutbox Shoutbox Open the Shoutbox in a popup

@  styleseye : (24 April 2014 - 02:29 PM) Https://www.facebook.com/l.php?u=Https://www.youtube.com/watch?v=Geh4Rs-Boh8&feature=Youtu.be&h=Taqexxpem
@  styleseye : (24 April 2014 - 02:28 PM) Https://www.facebook.com/l.php?u=Https://www.youtube.com/watch?v=Geh4Rs-Boh8&feature=Youtu.be&h=Taqexxpem
@  yordan : (21 April 2014 - 09:11 PM) Hey, Ritesh, Did You Hear Me?
@  yordan : (14 April 2014 - 05:28 PM) By The Way, This Could Be An Interesting Subject For A Topic, What About Posting This Question? Let's See If Other People Have The Same Feeling Concerning Bootlists!
@  yordan : (13 April 2014 - 09:36 AM) Boot Order : Cd, [Usb,] Hard Drive :D
@  yordan : (11 April 2014 - 07:23 PM) I Simply Let The Bios Do That
@  Ritesh : (11 April 2014 - 10:23 AM) Is It Possible To Launch Fedora Live Cd Or Installation Disk From Hard Drive On Windows Platform Using Grub Mbr File.
@  Ritesh : (11 April 2014 - 10:21 AM) No U Are Not.. Btw.. I Have Question For You.
@  yordan : (10 April 2014 - 08:02 AM) You Are Partially Right.
I Was Not.
Nevertheless, I Am Again :)
@  Ritesh : (09 April 2014 - 07:33 PM) :P
@  Ritesh : (09 April 2014 - 07:33 PM) I Think U R Not..
@  yordan : (09 April 2014 - 09:28 AM) I'm The Master Of The Shoutbox!
@  yordan : (05 April 2014 - 10:32 PM) He-He
@  Ritesh : (04 April 2014 - 06:59 PM) Ha Ha Ha ....
@  yordan : (04 April 2014 - 11:15 AM) Welcome Back, Starscream!
@  yordan : (03 April 2014 - 02:31 PM) And I Hope That He Will Come Back Soon :)
@  yordan : (01 April 2014 - 02:53 PM) Nice, Ritesh Came, I'm Not Home Alone Today.
@  Ritesh : (01 April 2014 - 08:51 AM) Oh!!! Poor Dear Yordan..
@  yordan : (31 March 2014 - 10:02 AM) I'm A Poor Lonesome Cow-Boy
@  yordan : (27 March 2014 - 02:22 PM) He Is Unpatient Due To His Patients!

Photo
* * * * * 1 votes

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


11 replies to this topic

#1 FirefoxRocks

FirefoxRocks

    Super Member

  • [HOSTED]
  • 988 posts
  • Gender:Male
  • Location:Ontario, Canada
  • myCENTs:92.36

Posted 05 February 2007 - 12:37 AM

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:
<object data="http://www.x-kings.com/public/banner/guild_short.php?name=XKingdom" type="text/html"></object>


A little more detail:
<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.

Edited by FirefoxRocks, 24 February 2007 - 04:08 PM.


#2 Guest_FeedBacker_*

Guest_FeedBacker_*
  • Guests

Posted 18 December 2007 - 04:01 PM

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

Thanks again,

Dan

#3 Guest_FeedBacker_*

Guest_FeedBacker_*
  • Guests

Posted 27 January 2008 - 02:15 AM

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 =)

#4 Guest_FeedBacker_*

Guest_FeedBacker_*
  • Guests

Posted 18 February 2008 - 04:10 PM

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

#5 toby

toby

    Super Member

  • Members
  • 611 posts

Posted 18 February 2008 - 05:49 PM

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).

#6 FirefoxRocks

FirefoxRocks

    Super Member

  • [HOSTED]
  • 988 posts
  • Gender:Male
  • Location:Ontario, Canada
  • myCENTs:92.36

Posted 19 February 2008 - 04:39 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 :P

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

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

-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.

#7 Guest_FeedBacker_*

Guest_FeedBacker_*
  • Guests

Posted 21 March 2008 - 08:21 PM

errata
Juggling An Iframe Box With Xhtml Sites

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

There is no 'I' in 'deprecated'.

#8 Guest_FeedBacker_*

Guest_FeedBacker_*
  • Guests

Posted 02 April 2008 - 04:08 AM

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

#9 Guest_FeedBacker_*

Guest_FeedBacker_*
  • Guests

Posted 18 April 2008 - 06:03 PM

Google Calendar
Juggling An Iframe Box With Xhtml Sites

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

-reply by Waner Del Rosario

#10 Guest_(G)Sientz_*

Guest_(G)Sientz_*
  • Guests

Posted 25 November 2008 - 09:42 PM

IE vs FirefoxJuggling An Iframe Box With Xhtml SitesIt 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


#11 Guest_(G)Chris Dillingham_*

Guest_(G)Chris Dillingham_*
  • Guests

Posted 03 February 2009 - 11:19 PM

Compliant XHTML for Google Calendar. Success!Juggling An Iframe Box With Xhtml Sites

I'm almost there with this code:

<!--[if lte IE 7]><iframe src="(your url goes here)" style=" border-width:0 " width="533" height="800" frameborder="0" scrolling="no"></iframe><![endif]--></p><p><!--[if  !IE]><!--></p><p><object data="(your url goes here)" style="width:533px; height:780px;" type="text/html"></object><!--<![endif]--><noscript><p>You must have JavaScript to display the calendar. </p></noscript>

If you check the wikipedia article on conditional comments, it'll explain why each works. Summary: In IE, it sees the first part as an instruction to process the first and the second part as an instruction to ignore. In standards compliant browsers, it sees the whole first part as a comment and the second part as two comments, a standards-compliant object, then another comment. Ideally everyone's happy, except maybe the webmaster who has to monkey all of this around.

 Naturally, modify the styles and the URL to what google calendar or whatever gives you.When IE 8 comes out, your actual mileage may vary.

 I hope that helps!

-reply by Chris Dillingham

 



#12 Guest_(G)_*

Guest_(G)_*
  • Guests

Posted 01 November 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>

  <![endif]--> 

</object>





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users