HTML - Javascript Problems When Validating Some Xhtml.
Ok, so, I have a copy of Macromedia Fireworks. I used it to create a rollover navigation bar for my site (see link at the end of this post).
Fireworks exports the file as HTML, and not XHTML, so the JavaScript in the code doesn't validate. The W3C Validator has found 4 problems (there was around 70,but i fixed those all up, because they were just img tag issues): If anyone knows JavaScript and can fix these (or at least help me fix them), please post! Link to the page in question: http://ericsartor.freehostia.com/new-template/ Just view the source to see what I'm talking about. Similar TutorialsHi. My entire site is 100% XHTML1.1. Except for some new code I added which causes errors in validation. the code is HTML Code: <a href="http://babelfish.altavista.com/babelfish/" onclick="window.open('http://babelfish.altavista.com/babelfish/trurl_pagecontent?lp=en_it&url='+encodeURIComponent(location.href));return false;" title="Translate to Italian"><img title="Italian" src="http://geekimo.com/licons/it.png" alt="Italian" /></a> I understand maybe CDATA islands can help with this? or making it external? but I have no idea how to do that with it having html code in there too.. I don't know if you can surround it in CDATA tags. There are other lines of code too, exactly the same except have different languages. Any help would be awesome! Hi I have a problem with rev= tag that wont validate. I am using Lightbox on the first 2 images on my webpage http://www.colletts.co.uk/colletts_n..._holidays.html where the caption on the lightbox image is linked to the relevant page with a rev link. This however doesn't verify 'Line 100, Column 120: character "/" is not allowed in the value of attribute "rev".' Does anyone know a way around this or should I just drop the link? Whadyareckon HTML Code: <a href="lightbox/via_ferrata_dolomites_tofana.jpg" rel="lightbox" title="Via Ferrata in the Dolomites" rev="http://www.colletts.co.uk/via_ferrata_and_klettersteig.html"> <img src="http://www.colletts.co.uk/images/via_ferrata_dolomites_italy.jpg" alt="Via Ferrata in the Dolomites" width="238" height="314" class="rpadding" longdesc="http://www.colletts.co.uk/images/via_ferrata_dolomites_italy.jpg"/> I am trying to validate but I am getting 24 errors, I fixed some and now down to 14, this error I am dealing with says: # Error Line 3, Column 68: end tag for "html" which is not finished <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"/> Most likely, you nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p> Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, in HTML the <head> element must contain a <title> child element, lists require appropriate list items (<ul> and <ol> require <li>; <dl> requires <dt> and <dd>), and so on. This my code: Quote: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"/> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>My Trip Around the USA on a Segway</title> </head> <body> what's wrong here please? Hi all, I've been asked to develop a tool using HTML and JavaScript to target two numbers in a 19 digit combination. The numbers I need to target are in location 8 & 9 (#######89##########) and need to yield one of two responses dependant if the number is less than or equal to what has been entered. So if number less than or equal to 12 I figure I can use layers to hide and reveal the responses and using JavaScript or HTML to target and make the correct layer visible after the complete number has been entered I'm at a loss on how to do this and where to start with my code to make this possible. If anyone can shed some light on what this type of feature is called so I can research it or if you can help me with some code or advice I'd be grateful Thanks I have been creating a website with Javascript. When the user rolls over an image button, the button will glow and when the user presses on the button it will change to and image of the button being pressed. This program has been working with at least 6 buttons but the current button i'm working on stops doing what the previous buttons did and I would like to know why. I copied the codes exactly the same as the previous buttons, changed the image picture and provided the correct links to each image but somehow it just stops working. Thank you for your help (: -=Example of the codes=- Button 1: <a href="'test2.htm" onMouseDown="pressButton('chatBtn');return true;" onMouseOver="overButton('chatBtn');return true;" onMouseOut="releaseButton('chatBtn');return true;"><img name=chatBtn src="images/chat.png" border="0" alt="Chat" /></a> Button 2: <a href='test.htm' onMouseDown="pressButton('backBtn');return true;" onMouseUp="overButton('backBtn');return true;" onMouseOut="releaseButton('backBtn');return true;"><img name=backBtn src="images/back.png" border="0" alt="Back" /></a> Javascript code: // Preloading Images if (document.images) { chatBtn_up = new Image(); chatBtn_up.src="images/chat.png"; chatBtn_down= new Image(); chatBtn_down.src="images/chatPress.png"; chatBtn_hover = new Image(); chatBtn_hover.src="images/chatHover.png"; backBtn_up = new Image(); backBtn_up.src="images/back.png"; backBtn_down= new Image(); backBtn_down.src="images/backPress.png"; backBtn_hover = new Image(); backBtn_hover.src="images/backHover.png"; } // Event Handlers for button function pressButton(btName) { if (document.images) eval('document.'+btName+'.src='+btName+'_down.src'); } function releaseButton(btName) { if(document.images) eval('document.'+btName+'.src='+btName+'_up.src'); } function overButton(btName) { if (document.images) eval('document.'+btName+'.src='+btName+'_hover.src'); } Which one is better? XHTML STRICT 1.0 or XHTML 1.1 ok guys i have a small code on button click i open a popup in that popup i have one radio button to be selected back to my main program how do i check which button has been selected ? should i show code? thank you Hello, I'm having trouble with javascript on my website. Hopefully somebody here can help me out. The website is http://www.mm-theory.com The problem arises when you click on the little asterix in the left-hand margin, the one that says "click me" underneath. It tells you you need to have javascript enabled even though you may already have it enabled. I get this problem only when I have the omni slide menus at the top and the right side (the ones that say "quick links" and "papers" and open up when you move the mouse cursor over them). I got the code from http://www.dynamicdrive.com/dynamici...lide/index.htm and followed their instructions to the letter. I don't get this problem when I remove the menus. The code for the asterix link is as follows: Code: <a class="margin_icon" onclick="openWin('deeper_problem.htm','',600,1);return false;" href="enablejs.htm" target=_blank> <img class="margin_icon" src="icons/side.gif" alt="side.gif" border=0> <br> <span class="margin_icon"> Click Me! </span> </a> The code for the openwin function is as follows: Code: function openWin(url,name,wid,hgt) { sw=(screen.width-wid)/2; sh=(screen.height-hgt)/2; newwin=window.open(url,name,'width='+wid+',height='+hgt+',top='+sh+'+sh+',left='+sw+',scrollbars=0,menubars=0,toolbars=0,directories=0,location=0,address=0'); mewwin.focus(); } This function is made available on the home page I linked you to (http://www.mm-theory.com) by the following code in the head section: Code: <script language="javascript" type="text/javascript" src="openwin.txt"></script> Can anyone tell me why it says I need to enable javascript when javascript is already enabled? Damn, am I needy or what? Could someone tell me why my code is not validating. HTML Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Welcome to Streams of Dreams Fly Shop - NJ's premier fly fishing source!</title> <style type="text/css"> #wrapper {margin: 0px auto; padding: 0px; width: 850px; text-align: center; } #banner {width: 850px; height: 135px; } #banner img {width: 850px; height: 135px; } #menuh {width: 850px; height: 21px; } #menuh ul{margin-left: 0px; padding-left: 0px; list-style: none; float: left; } #menuh ul li{float: left; width: 100%; } #menuh a {height: 1%; font: bold 0.7em/1.4em arial, sans-serif; } #menuh-container { position: center; top: 0; left: 0; width: 850px; } #menuh { font-size: small; font-family: arial, helvetica, sans-serif; width:100%; float:left; margin:0; margin-top: 0; } #menuh a { text-align: center; display: block; border: 1px solid #555; white-space: nowrap; margin: 0; padding: 0.3em; } #menuh a:link, #menuh a:visited, #menuh a:active /* menu at rest */ { color: white; background-color: #003459; text-decoration: none; } #menuh a:hover /* menu at mouse-over */ { color: white; background-color: cornflowerblue; text-decoration: none; } #menuh a.top_parent, #menuh a.top_parent:hover /* attaches down-arrow to all top-parents */ { background-image: url(navdown_white.gif); background-position: right center; background-repeat: no-repeat; } #menuh a.parent, #menuh a.parent:hover /* attaches side-arrow to all parents */ { background-image: url(nav_white.gif); background-position: right center; background-repeat: no-repeat; } #menuh ul { list-style: none; margin: 0; padding: 0; float: left; width: 94.4px; /* width of all menu boxes */ } #menuh li { position: relative; min-height: 1px; /* Sophie Dennis contribution for IE7 */ vertical-align: bottom; /* Sophie Dennis contribution for IE7 */ } #menuh ul ul { position: absolute; z-index: 500; top: auto; display: none; padding: 0; margin: 0; } #menuh ul ul ul { top:0; left:100%; } div#menuh li:hover { cursor: pointer; z-index: 100; } div#menuh li:hover ul ul, div#menuh li li:hover ul ul, div#menuh li li li:hover ul ul, div#menuh li li li li:hover ul ul {display: none;} div#menuh li:hover ul, div#menuh li li:hover ul, div#menuh li li li:hover ul, div#menuh li li li li:hover ul {display: block;} #content1 {width: 850px; height: 20px; vertical-align: top; } #content2 {width: 850px; height: 306px; vertical-align: top; } #content3 {width: 850px; height: 250px; vertical-align: top; } #copyrite {width: 850px; height: 72px; } #copyrite img {width: 850; height: 72px; } .style1 {color: #663333} </style> </head> <body> <div id="wrapper"> <div id="banner"> <img src="Images/Banners/nwbanner.jpg" alt="nwbanner" width="850" height="144" /></div> <div id="menuh-container"> <div id="menuh"> <ul> <li><a href="#" class="top_parent">Home</a> </ul> <ul> <li><a href="#" class="top_parent">Fly Shop</a> <ul> <li><a href="#" class="parent">Rods</a> <ul> <li><a href="#">Thomas and Thomas</a></li> <li><a href="#">Scott</a></li> <li><a href="#">Beulah</a></li> <li><a href="#">Temple Fork</a></li> </ul> </li> <li><a href="#" class="parent">Reels</a> <ul> <li><a href="#">Abel</a></li> <li><a href="#">Mako</a></li> <li><a href="#">Saracione</a></li> <li><a href="#">Hatch</a></li> </ul> </li> <li><a href="#" class="parent">Waders</a> <ul> <li><a href="#">Dan Bailey</a></li> <li><a href="#">Chota</a></li> <li><a href="#">Hodgman</a></li> <li><a href="#">Patagonia</a></li> </ul> </li> <li><a href="#" class="parent">Wading Shoes</a> <ul> <li><a href="#">Chota</a></li> <li><a href="#">Patagonia</a></li> <li><a href="#">Hodgman</a></li> <li><a href="#">Simms</a></li> </ul> </li> <li><a href="#" class="parent">Accessories</a> <ul> <li><a href="#">Fly Lines</a></li> <li><a href="#">Fly Boxes</a></li> <li><a href="#">Nets</a></li> <li><a href="#">Clothing</a></li> </ul> </li> </ul> </li> </ul> <ul> <li><a href="#" >Photos</a> </ul> <ul> <li><a href="#" >Destinations</a> </ul> <ul> <li><a href="#" >Events</a> </ul> <ul> <li><a href="#" >Lessons</a> </ul> <ul> <li><a href="#" >Spey</a> </ul> <ul> <li><a href="#" >Bios</a> </ul> <ul> <li><a href="#" >Contact Us</a> </ul> </div> <!-- end the menuh-container div --> </div> <!-- end the menuh div --> <div id="content1"></div> <div id="content2"></div> <div id="content3"></div> <div id="copyrite"><img src="Images/Banners/copyrightbar.jpg" alt="CopywriteBar" /></div> </div> </body> </html> <form method="post" enctype="text/plain" action="mailto:paradox@hotmail.com"> <table cellpadding="10"> <tr> <td class="style4">Full name:</td> <td colspan="2"><br><input type="text" name="first" size="30"></td> </tr> <tr> <td class="style4">Company name:</td> <td colspan="2"><input type="text" name="surname" size="30"></td> </tr> <tr> <td class="style4">Email address:</td> <td colspan="2"><input type="text" name="sender" size="30"></td> </tr> <tr> <td class="style4">Phone number:</td> <td colspan="2"><input type="text" name="phone" size="30"></td> </tr> <tr> <td class="style4">I prefer contact by:</td> <td><input type="radio" name="contactpreference" value="email"><span class="style4">Email</span></td> <td><input type="radio" name="contactpreference" value="phone"><span class="style4">Phone</span></td> </tr> <tr> <td class="style4">Service of Interest:</td> <td colspan="2"> <select name="q" size="1"> <option>Anatomy Web design and development</option> <option>Anatomy E-learning</option> <option>Anatomy Graphics</option> <option>Anatomy Flash</option> </select> </td> </tr> <td class="style4">Comments/Feedback</td> <td colspan="2"><br><textarea cols=40 name="Comments" rows="6"></textarea></td> <tr> <td id="botton" colspan="3"><input type="reset" value="Reset"><input type="submit" value="Submit"></td> </tr> </table> </form> I am setting up a newsletter.I have validated it and have this one annoying error. document type does not allow element "P" here; missing one of "APPLET", "OBJECT", "MAP", "IFRAME", "BUTTON" start-tag Now, I dont want to use css since as im not sure how many email programs will pick it up..so to be safe im using just the basic font tag system. I get the above error from this example. <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> <P>Testing testing </> </font> I also tried putting a style in the body but the outlook doesnt pick it up,well mine anyways since its outlook 2000. any advice thanks Hi, Im really new to this site and to HTML in general. I am having trouble validating this page and would greatly appreciate some help. I am attaching the text file if anyone can help. Thanks in advance. Yes, I have read the sticky but am still a little stuck. Well hi there, I've been altering and adding to my website over the last few months, and I've decided it's almost complete. I decided to try and make what was already complete w3c compliant (using the w3c validator), and I've hit a tree. This is involves my index.html which uses frames. Well after I discovered that I must set the doctype to HTML frameset, there were two remaining errors which I could not resolve. I have spent ages googling but I haven't found much useful. here are the errors Quote: Line 15, Column 6: end tag for element "HEAD" which is not open. </head> The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem. If this error occurred in a script section of your document, you should probably read this FAQ entry. Line 16, Column 5: document type does not allow element "BODY" here. <body> The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed). One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error). Here is my index.html (yes I know I used loads of br's): Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <meta http-equiv="Content-Language" content="EN-GB"> <link rel="stylesheet" type="text/css" href="theme.css"> <title>Revelations of the Ancients</title> <frameset cols="16%,84%"> <frameset rows="80%,20%"> <frame name="sect" id="sect" src="sections.html"> <frame name="val" id="val" src="val.html"> </frameset> <frame name="main" id="main" src="home.html"> </frameset> </head> <body> <center> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <p>Revelations of the Ancients is a game made with the X-Realms engine.<br> Affiliate site: <a href="http://www.newworlddynasty.com/">www.newworlddynasty.com</a></p> <h1><u>News</u></h1> <p>17.12.07: People who want to play the game once it enters <b>open beta stage</b> view this thread <a href="http://rota.freeforums.org/viewtopic.php?p=10#10"target="_blank">here</a>!</p> <b><a href="news.html">View all news</a></b> </center> </body> </html> This peace of code is the only part of my page not validating. <style type="text/css" media="screen"> #header { background: url("http://SITEADDRESS.com/img/header2.jpg") no-repeat bottom center; } </style> How can I get it to validate? Hi, Just a quick post here to ask for some help. My website (http://www.anewtake.com/ted) which I am making, works fine in Safari and Chrome. However, it does not work quite in Firefox: the top bar, where it says 'welcome' is placed too far over to the right. I'm not sure whether it works in IE7 or IE8, because it won't install on my computer! And I'm not bothered about IE6 because it's just old. So my question is; can anyone help me with getting this page to work in Firefox and validate? Thanks, Ted Hello everyone, I'm new here and need a little help. I'm getting two errors on my validate and was hoping someone can see something I'm not seeing. I'm new to xhtml/html so any help I would be very grateful. Here are the two errors Code: Error Line 209, Column 33: document type does not allow element "ul" here; assuming missing "li" start-tag <ul class="children"> ✉ Error Line 248, Column 15: end tag for "li" omitted, but OMITTAG NO was specified </ol><!-- /end msgs-list --> ✉ You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">". Info Line 209, Column 13: start tag was here <ul class="children"> and here is the code HTML Code: <ol class="msgs-list"> <li> <div class="msg-entry"> <div class="author"> <p><a href="#">Author Name</a></p> <p>Posted: 01-01-11<span class="sep">12:41</span></p> </div> <div class="msg-body"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> </div> </div> </li> <ul class="children"> (LINE 209) <li> <div class="msg-entry"> <div class="author"> <p><a href="#">Author Name</a></p> <p>Posted: 01-01-11<span class="sep">12:41</span></p> </div> <div class="msg-body"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> </div> </div> </li> </ul> <ul class="children"> <li> <div class="msg-entry"> <div class="author"> <p><a href="#">Author Name</a></p> <p>Posted: 01-01-11<span class="sep">12:41</span></p> </div> <div class="msg-body"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> </div> </div> </li> </ul> <ul class="children"> <li> <div class="msg-entry"> <div class="author"> <p><a href="#">Author Name</a></p> <p>Posted: 01-01-11<span class="sep">12:41</span></p> </div> <div class="msg-body"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> </div> </div> </li> </ul> </ol><!-- /end msgs-list -->(LINE 248) Many thanks whats wrong here? its been bugging me for ages!!! Code: <script> function Blank_TextField_Validator() { // Check the value of the element named visitor_name // from the form named my_form if (my_form.visitor_name.value == "") { // If null display and alert box alert("Please fill in the text field."); // Place the cursor on the field for revision text_form.text_name.focus(); // return false to stop further processing return (false); } // If text_name is not null continue processing return (true); } </script> <form id="my_form" action="#" name="my_form"> <p>Please enter your name:</p> <input type="text" name="visitor_name" id="visitor_name" /> <input type="submit" value="Submit" /> </form> I need to make sure my site is validated with XHTML but i don't think Dreamweaver is doing it right. I made one page and it said it was all good but i left some span tags open. It never mentioned that though. So how do i validate in Dreamweaver against XHTML? Where do i check what it validates against? In the Validate menu it says "If no DOCTYPE is detected, validate against" then has a list of HTML 2, 3, 4, XHTML 1..etc Does that mean i need to remove the DOCTYPE that's in the code or just make sure it's the right one I'm validating againt? Thanks for any help. |