473,503 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validation: iframe , onmouseover and doctype

I've got a page with an iframe in it, and a javascript that handles an
onmouseover/onmouseout for it. Everything WORKS, but it doesn't
validate...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> <html>
<head>
<title>test</title>
</head>
<body>

<iframe id='ifID' name='ifName' src='if.html' onmouseover='over()'
onmouseout='out()'>no content </iframe>

</body>
</html>

What doctype should I be using? Or do I just say forget about it?

--
J.B.Moreno
Sep 7 '05 #1
2 5527


J. B. Moreno wrote:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> <html> <iframe id='ifID' name='ifName' src='if.html' onmouseover='over()'
onmouseout='out()'>no content </iframe> What doctype should I be using? Or do I just say forget about it?


If you want to use the onmouseover/out attributes on the iframe element
in the markup then I think you need to write your own DTD extending the
HTML 4 DTD as needed to be able to validate the document without errors.

Depending on your needs you could of course decide to make the document
valid against the W3C HTML 4 DTD as far as possible but accept getting
errors on those two attributes.

Or you could remove the attributes from the markup and use script to set
event listeners as needed with script alone.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 7 '05 #2
Ma***********@gmx.de wrote:
J. B. Moreno wrote:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> <html>
<iframe id='ifID' name='ifName' src='if.html' onmouseover='over()'
onmouseout='out()'>no content </iframe>

What doctype should I be using? Or do I just say forget about it?


If you want to use the onmouseover/out attributes on the iframe element
in the markup then I think you need to write your own DTD extending the
HTML 4 DTD as needed to be able to validate the document without errors.


OK, thanks.
Depending on your needs you could of course decide to make the document
valid against the W3C HTML 4 DTD as far as possible but accept getting
errors on those two attributes.
Probably best to just let those two errors go -- I'm not fanatical about
validation, and this seems to be a reasonable case of ignoring it.
Or you could remove the attributes from the markup and use script to set
event listeners as needed with script alone.


The scripting on this page is supposed to be handled by someone else.

--
J.B.Moreno
Sep 8 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4655
by: Martial Spirit | last post by:
Hello- I was amazed at the suckerfish drop-downs from AListApart.com. They work great except for one thing, if I position the drop-downs over an iframe element, on mouseover the menus disappear....
10
3567
by: Steve Benson | last post by:
Our regular programmer moved on. I'm almost clueless in Javascript/ASP and got the job of adapting existing code. In the page below, everything works until I added the function checkIt() to...
7
3570
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
6
2409
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: ...
2
2859
by: Bart van Deenen | last post by:
Hi My program has a sort of dynamic popup when hovering over an icon. It uses an iframe with visibility:hidden, and an onload handler to make it visible after the server replies. The Contents...
16
2909
by: J. C. Denton | last post by:
I just manually validated alexa's global top 100 sites and find only 2 sites that pass validation. They are http://www.microsoft.com/ http://www.wikipedia.org/ All others should go w3c...
3
1350
by: tequilamala | last post by:
I have 2 errors left on my default.htm but i can't figure it out. I have a <body> error and a </html> error. My website is escamillalaw.com <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01...
1
8112
by: Z1P2 | last post by:
I would like to gradually resize an iframe in an onmouseover event. I can easily do it with an image, but when I try to do it with an iframe, it doesn't do anything. So first of all, is it possible...
10
3726
by: AC | last post by:
I had a page that does some event setup on window.onload: function prepEvents() { document.getElementById("menumap_sales").onmouseover = swapMenuSales; // etc } window.onload = prepEvents;
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7074
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7273
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7322
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7451
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5000
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
374
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.