Click to See Complete Forum and Search --> : iframes... valid? foo!
khaki
04-27-2003, 02:25 PM
I just tried validating (strict) a page that contains an iframe.
Every attribute returned an error.
Here are the elements:
<iframe
name="frName"
id="frID"
src="myPage.asp"
frameborder="0"
width="650"
height="500">
</iframe>
I know that i can place some of the attributes in a stylesheet...
but are iframes not valid?
Also... is it ok to have nothing between the tags (i don't really want anything to be there... just the source page)?
<iframe>(nothing in here is ok?)</iframe>
and...
should I use Name or ID or both (in case I need to reference it for whatever reason)?
okay... enough questions (for now :rolleyes: )
;) k
AdamGundry
04-27-2003, 02:31 PM
<Iframe> is valid HTML, but I believe only in the loose DTD. All the attributes you have there are valid in the correct DTD.
You should really have a hyperlink to the contained page between the tags, in case the browser does not support iframes, but this depends on the application.
The name/id thing is up to you - I personally prefer using ID and document.getElementById(). Both might be a good idea for cross-browser compatibility - I'm not sure.
Adam
khaki
04-27-2003, 02:50 PM
hmmm...
good info Adam ;)
thanks
I guess I'll have to be "loose" on that page (grrrr).
I put an href tween the tags and it didn't blow anything up... so that's a good tip ...
(i figured that you should probably have something in there).
Although I can't image how it would look (or load) for a browser that doesn't support them :confused:
But...
how far back (versions) do browsers need to be to support iframes?
I gotta admit that I'm falling in love with them (just like frames... but 1 less page and easier to manipulate)!
First I stopped using tables for layout...
now I completely jettisoned frames for dynamic data queries...
... the new direction of web development is definitley more fun than the old ways!
(now if everybody would just upgrade their browsers so that i can play without guilt! :( ).
;) k
AdamGundry
04-27-2003, 03:00 PM
Although I can't image how it would look (or load) for a browser that doesn't support them
An interesting experiment is to look at your pages in a text-only browser, such as Lynx. (Online preview available here (http://www.delorie.com/web/lynxview.html). It shows how your pages look in a text-only browser or to a blind person with a screen reader.
how far back (versions) do browsers need to be to support iframes?
I believe IE 3 supports them, and I guess recent versions of NS do, though I'm by no means certain.
now if everybody would just upgrade their browsers
...to Mozilla. :D
Adam
khaki
04-27-2003, 03:16 PM
uh-oh....
Dave... you've confused me :confused: (<<< see?)
Now... when you say:
"name is the age-old standard"
... that's a good thing... right :confused:
(as opposed to the "old-age standard"... which is something else entirely. lol)
okay so if so... (huh?) ...
then what do you mean when you say:
"id is for the latest DOM referencing method"
...isn't "the latest" what I am after :confused:
(so that i can take advantage of all the hot new ways of controlling/manipulating ID'd items?)
and...
can't I just use both...
or will I cause the entire internet to crash by doing that :rolleyes: lol
OR (!)...
can i give it NO name or NO id
(if i don't need to refer to it and just want to use it as a container)?
with air escaping from my head...
;) k
khaki
04-27-2003, 03:20 PM
hey Adam...
I checked my page at that Linux link...
:eek: :rolleyes: :( :eek: :rolleyes: :(
(uh-oh!)
;) k
khaki
04-27-2003, 03:33 PM
yikes!
it's a little embarassing to post back-to-back-to-back (although I've done it in the past... more than a few times, actually... :rolleyes: ) but...
is there any "harm" (other than an unintended deception.... or as Charles would say: LIAR!) if I had "strict" on my iframes pages instead of "loose"?
(is it called "loose"? Not "transitional"... or something like that?)
Anyway...
I will go back and change them all (ugh!)...
but until then...
any "harm" (the pages still get read correctly... right?).
sorry... but i have freaked myself-out over this stupid little issue (I keep striving to be "strict"... but I guess that sometimes it's not really possible and I need to adapt to that concept).
so :confused:
;) k
edit: sorry... but the Dew has me riding the razor's edge today :rolleyes:
Charles
04-27-2003, 06:47 PM
A couple of things.
Don't worry about browsers that do not support inline frames. Anything in a 4.01 DTD is fair game. However, you need to follow the 4.01 Specification. A proper IFRAME looks like
<iframe src="http://www.w3.org/"><a href="http://w3.org/">W3C</a></iframe>
Note that thusly any browser that does not understand inline frames will, nonetheless, display the link and all will be right with the world.
When viewing your page in Lynx, it is important to imangine some one hearing the text . In fact, get your spouse or roommate to read the page to you. If you use tables for layout and have a long list of links down the left side of the screen, those links will be at the top of the page in Lynx. Imangine having to listen to that list everytime you hit every page in your site.
Robert Wellock
04-29-2003, 10:22 AM
Downloading JAWS for Windows is a fairly useful activity and Netscape 4.7x never correctly supported <iframe> however Mozilla 1.x onwards have no problem with <iframe> rendering.
Aslong as you remember to use the correct fallback mechanisms you're halfway there. Furthermore XHTML 1.1 does not support <iframe>.
khaki
04-29-2003, 10:51 AM
Furthermore XHTML 1.1 does not support <iframe> Is that because you can create your own :confused:
(i really have no idea... so i'm just asking)
:rolleyes: k
Robert Wellock
04-29-2003, 12:50 PM
Basically the <iframe> was a poorly thought out idea from M$ that somehow entered the W3C Specifications and it took until the XHTML 1.1 Recommendations before they finally had the courage to completely discard the element due to various issues and the fact that <object> in general was more functional.
nkaisare
04-29-2003, 01:00 PM
As charles said, you should provide contents between <iframe></iframe> for the same reason as providing an alt text for an image.
This may not be true in your case... but I have seen some people using iframe not really to include another html, but for layout effect. Viz. to limit a lot of text to a small portion of the screen. If thats your purpose, you can use:
<div style="width: 150px; height: 300px; overflow: scroll">
khaki
04-29-2003, 01:16 PM
completely discard the element due to various issues and the fact that <object> in general was more functional... and that applies to only xhtml?
html, shtml, asp.... these are still okay with <iframe>?
and...
is <object> cross-browser (without a plug-in) in non-xhtml pages? (i'm assuming that it's not)
Then... does using <object> inside of an xhtml file make it accessable in a cross-browser environment (similar to running VBScript inside of an ASP page)?
(so many questions!!! lol)
;) k
oh... and nkaisare...
i'm using <iframe> as a substitute for frames in my asp apps (so that i still have the aility to have static sections that control dynamic sections).
"Layout"?!!! What kind of girl do you take me for?!!! lol ;)
Robert Wellock
04-29-2003, 02:44 PM
The <object> is not only for plugins you can use it for a substitution for the <img> element the W3C was seriously considering deprecating the <img> element in favour of the <object>.
I like they layout joke :D.
khaki
04-29-2003, 03:07 PM
The <object> is not only for plugins actually... i think that you misunderstood me (get in the back of the line with the rest of 'em! lol) :rolleyes:
i guess what i meant was...
is <object> supported by all browsers?
i never use <object> because:
a) i don't think that i ever needed it for anything... so i never tried wedging one into one of my pages just for the heck of it...
and...
b) i thought that it was an IE-only tag that required a plug-in for Netscape.
so i guess the next question (when you are done with the previous 2 ... lol) is:
can i use <object> in place of <iframe> in a non-xhtml page and will it do for me what <iframe> does for me now? (including the ability to format and control it with stylsheets)
whew... i'm outta breath! :eek:
and just for the record... it wasn't me who brought-up the subject of the <object> tag.... ... it was you!!!!! LOL.
oh... and by the way...
i have some questions about Black Holes and the expansion of the Universe...
but those can wait until you answer all of my other questions first :rolleyes:
just fun'in....
;) k
Robert Wellock
04-30-2003, 12:33 PM
Obviously not all user-agents support the <object> element though any of the mainstream browsers that support HTML 4.01 have be programmed to accommodate <object> even the XHTML Basic 1.0 Recommendations for Small Information Appliances recognise its importance.
Clearly the <iframe> or <object> are different in nature as is <b> and <strong> evidently it is not possible to style <object> with CSS since an object is a "replaced element" as is the <img> element although the contents of the <object> themselves could possess style.
Referring to the less complex question about 'black holes' they're are infinite in there existence and can even 'swallow time' since time is expressed as the speed of light in a vacuum.
khaki
04-30-2003, 12:47 PM
oh.... hmmm... okay...
thanks for that (and the other thing ;) )
but... now i got a good one:
can I use <object> as follows
<object id="objID" name="objNm" src="somePage.asp"><a href="somePage.asp"></a></object>
...and have it nest the "somePage.asp" file into my page (the way that it can be done with <iframe>?
'cause i got another problem going (thread: http://forums.webdeveloper.com/showthread.php?s=&threadid=8778 ) that needs a creative solution... and i was just hoping..........
;) k
khaki
04-30-2003, 12:54 PM
oh... nevermind :(
i got off my lazy butt and tested it myself.
okay... i'll forget about <object>.
i haven't used it so far...
and i'll just wait until i really need it before i start.
by the way... my computer is also a black-hole...
because it also swallows time
(and it just happens to be black... a black Dell)
COINCIDENCE?!!!
not likely!!! :eek:
thanks again...
;) k