The way the validator is currently set up, if you want the page to validate in HTML 5, you cannot use rel like that. You could use a data dash (data-id might be good) attribute instead. But then you would have to change all references to rel in the script to data-id. And make sure it's always referenced as an attribute. The rel attribute is so ubiquitous that it often can be referenced as a property of the element. I'm not sure if this script does so or not. But the data dash attributes (new in HTML 5), though valid, almost always need to be referenced in javascript as attributes, not as properties.
As it turns out, there is only one reference and it is as an attribute, around line #259 in the script:
Code:
setupmenu:function(targetclass, anchorobj, pos){
this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
var relattr=anchorobj.getAttribute("rel")
dropmenuid=relattr.replace(/\[(\w+)\]/, '')
var dropmenuvar=window[dropmenuid]
var dropmenu=this.addDiv(null, dropmenuvar.divclass, dropmenuvar.inlinestyle) //create and add main sub menu DIV
dropmenu.innerHTML=this.getmenuHTML(dropmenuvar)
var menu=this.menusmap[targetclas . . .
Make that:
var relattr=anchorobj.getAttribute("data-id")
Do yourself a favor and add a line after that as well so you have:
Code:
setupmenu:function(targetclass, anchorobj, pos){
this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
var relattr=anchorobj.getAttribute("data-id")
if(!relattr){return;}
dropmenuid=relattr.replace(/\[(\w+)\]/, '')
var dropmenuvar=window[dropmenuid]
var dropmenu=this.addDiv(null, dropmenuvar.divclass, dropmenuvar.inlinestyle) //create and add main sub menu DIV
dropmenu.innerHTML=this.getmenuHTML(dropmenuvar)
var menu=this.menusmap[targetclas . . .
That will avoid an error on menuanchorclass links that have no drop downs.
Then change this and similiar:
Code:
<a href="mission.html" class="menuanchorclass" rel="anylinkmenu1">About Us</a>
to:
Code:
<a href="mission.html" class="menuanchorclass" data-id="anylinkmenu1">About Us</a>
About the script comment. I'm sure DD doesn't mind as long as it appears in the page's source code. I have run into problems validating javascript comments that contain link text (highlighted in the below) in HTML 5:
Code:
<script type="text/javascript" src="anylinkmenu.js">
/***********************************************
* AnyLink JS Drop Down Menu v2.0- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Project Page at http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm for full source code
***********************************************/
</script>
None were as severe as what you're describing. I found that all I had to do was change the multi-line comment to single line comments:
Code:
<script type="text/javascript" src="anylinkmenu.js">
//***********************************************
//* AnyLink JS Drop Down Menu v2.0- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
//* This notice MUST stay intact for legal use
//* Visit Project Page at http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm for full source code
//***********************************************/
</script>
It looks as though this will work for your page as well.
I think this is a glitch in the validator though, as a multi-line comment is supposed to be just as good as several single line ones. But who knows what those people who make up the standards are thinking.
In any case, after doing things as described here and in ddadmin's post, the page worked and and the only validation error left was on the frameborder attribute for the iframe.
That can be fixed by changing the socialmedia division to:
Code:
<div id="socialmedia" style="text-align:center"><!--[if lt IE 9]>
<iframe id="iframefacebook" frameborder=0 src="http://www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FUNH-MUB%2F120926084616822&width=292&colorscheme=light&show_faces=false&border_color&stream=false&header=true&height=62" style="border-width:0; overflow:hidden; width:292px; height:62px;" ></iframe>
<![endif]--><iframe class="standard" id="iframefacebook" src="http://www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FUNH-MUB%2F120926084616822&width=292&colorscheme=light&show_faces=false&border_color&stream=false&header=true&height=62" style="border-width:0; overflow:hidden; width:292px; height:62px;" ></iframe></div>
And adding this to the head:
Code:
<!--[if lt IE 9]>
<style type="text/css">
.standard {display: none;}
</style>
<![endif]-->
Bookmarks