Hi everyone I have an odd problem. I build my pages and try and make sure they are valid, and always check at w3c. What I have noticed is that a few of my pages have links within the content to other documents and the link string inside the <a href.. tag has characters or words that make the page not validate any more. example: my declaration at the top of the page: <!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"> <head> HTML: and within the page I have a link to an external source, but the string is long and when I try to validate the page (with the link included) the page turns invalid with errors in the string of characters in the link. Example link: http://portal.hud.gov/portal/page?_pageid=73,7601299&_dad=portal&_schema=PORTAL (this is inside a regular <a href.. tag) if I comment out the link , so that the words within my content are no longer linked but regular text instead the page is valid. if they are an active link pointing to that address the page doesnt validate anymore. samples of the same page where everything is the same except the link active/ inacvtive as I described. The page that validates is here The same page which no longer validates is here The linked words (summary of the negatives) are under the paragraph starting with: The Negatives of the H4H Does anyone know what I could here to keep the link but also have the page validate? thanks in advance Sami
Validation is a nice debugging tool, but it is not the be-all end-all of whether a site is well-coded. In fact, there are many useful features that are available within HTML, such as target="_blank" attributes, that won't validate under strict XHTML. Just one example. If it doesn't interfere with the user experience, and works right in all the important browsers, don't worry about it. If it is really bothering you that much, the only reason it is happening is that the GET variables that you are passing in the link, are beginning with an _underscore, which the validation is choking on. But again, as long as the data is getting passed correctly, it doesn't matter.
your example .... www.site.com/page.php?var1=val1&var2=val2.... Instead of & use & so the valid link is: www.site.com/page.php?var1=val1&var2=val2....
Hi guys thanks for the input wayfarer - I agree its not something absolute at all, that I need to "force" by all means, but I figured there might be a simple way to take care of this particluar hick up. Sojic: ok i see what you mean, I'll give it a try the problem is I have other links on other pages that produce even more errors than just the "&" sign thanks again guys. Sami
Absolutely false. Validation is error checking. If you allow errors in your markup then you are relying on the browser to figure out what you meant to do rather than telling the browser what you want. You are also relying on the same error to work the same in all browsers at the same time AND that error fix to continue to every version change of all browsers. Thinking invalid pages are OK is not very bright.
Hi drhowarddrfine I actually am quite prescise to get everything to validate but have recently been changing my mind about its ultimate "worth" I was reading articles about the future and how there sems to be no concensus/agreement on what the standrads are going to be in a little while. Also the fact that new browsers are letting you get away with stuff now adays. I personally think that yes if you make a page you might as well do it properly and make sure it validates but compared to sometime ago when (not sure if majority) but a large number of webmaster were building sites without a clue of standards. I did pose my questions too for the purpose of gettinga page to validate alltough it was crossbrowser compattible nevertheless, and at least I couldnt foresee any problems with or wiothout fixing the issue (which I still didnt get to do ). You see what I mean - Its important but at the same time not wortha heart attack if all else is done appropriately. And thanks again for the comments. sami
That there is no reason to force valid markup is true. No force is involved; you just do it. It is too simple a matter to write proper syntactical x/html to ever use invalid markup. In this case, there is the invalid use of a reserved character. Certain characters have a special purpose in html. The ampersand (&) introduces numeric and alpha character entities, the lt (<) and gt (>) characters delimit element tags, and the apostrophe (') and quote (") characters delimit string literals. The use of these characters for any other purpose is to invite browser error or confusion. Knowing this, why would you ever not code them as character entities? wayfarer07 mentioned using target="_blank" as a sane use of invalid markup. I believe, but would have to double check, that it is returning in html5. That does not mean it's a Good Thing®; in fact, it's a good example of poor practice. It mixes behavior with structure in the same way that <center> mixes in presentation. Having a linked page open in a new window belongs in the realm of scripting, because it separates behavior and structure, it improves ease of maintenance, it allows the re-use of code, and it reduces bandwidth. cheers, gary
You know, in the general scheme of all this, (behaviour/content/presentation) someone's gotta say, they fucking BLEND. I was watching and yapping in a thread on another forum about the target=blank thing, and many people said: "It's a behaviour, therefore it belongs in Javascript and not in the HTML". Seriously, if I spend a moment thinking about it, that's a load of crap. Clicking a blue underlined piece of text which takes me to a magical world of... another web page is ALSO a behaviour. Behaviour built into the HTML itself, yes, but it's definitely behaviour and thinking about it, there is a small, semantic difference between opening the new link in the current window (valid) and opening it in another one (not valid). So would we Javascript normal link clicking too? (not that there aren't tards who do this, and they piss me off!!! I'm talking to you, makelaardijen van Nederland! Your sites SUCK). No, as Javascript, like images and other things, are extras and it's a good thing to let HTML do what it does most of the time. How about making a tooltip appear on :hover? Isnt' that a behaviour? Is there actually a difference between :hover and onMouseover??? They do the same thing, how can one be a behaviour and the other presentation??? They are the same. The three blend. In trying to keep them separated, we need to decide (rationally and not stoned on standards doobies) who should be separate and who should be together. That target=blank causes a lot of problems for some people shouldn't be relevant to that argument, but belongs in another (important!) argument. Validation is a Good Thing but your doubts are coming from the fact that you're realising that it's basically the same as checking your report in a spell and grammar checker. It can catch your Stupid Moments and silly typos. it cannot catch your badly-checked facts or ensure that your paper is actually any good. So, validation is a sort of extra. Now, would you send in your resume to IBM with spelling errors and the like because you know the spellchecker can't guarantee that you wrote the content well? Of course not-- a bunch of spelling mistakes still make you look like a tard, and you may not get the job. So you validate and validate again, for that reason. Does it matter that you have unescaped special characters? In today's browsers, no. But as DrHoward said, you'll be shit up a creek when some next-generation browser appears who actually demands you speak correct browser-ese to it. Because right now what most of us are speaking when we write tag-soup HTML is Me speek Engrish are eggshellent! Does the browser understand? Sure, though they all understand slightly differently (which is the danger here). Is it good English? Hell no, it's garbage. And a good web developer who actually cares about his job or his profession doesn't want to throw even more shit out there into teh InterTubes just to get paid. Instead, he says, you know, there is such a thing as properly saying "We are" and not "we be". Regardless if both are understood. BTW the other errors you get are often caused by the &... for instance, the = after the & will be called an error too. But if you escape the & with & the = error vanishes. The only possible good thing about HTML 5 is that they've decided to make it so that, when people do write garbage, the garbage is treated the same way cross-browser (which it isn't, currently)... and this might suck balls too if it encourages people to say, Oh, well then I can just keep living in my dirty trailer and still don't have to shower cause it's all gonna be ok... I guess we'll see, too many browser vendors are implementing HTML5 already... </rant en spew> : )
It is true that there is overlap, but the examples you presented are presentational. The link is blue because the stylesheet says so, even if it is built in to the browser stylesheet. So is the action of the :hover pseudo class, though there is definitely a crossover with scripting. The real evil of mixing behavior and presentation into the structure is the loss of orthogonality, and the subsequent loss of code re-use. cheers, gary
Info to anyone reading this thread, I fixed the issue thanks to the help I got and so removed the file and so the link to the invalid file is now dead. And thanks again to all posters.(we managed to heat things up just enough to keep it interesting) Sami
I wasn't referring to the link being blue, I was referring to the anchor taking me to another page-- that is a behaviour and not a style. My point was, people who say <a href="blah" "target=blank"> is a behaviour and therefore needs to be Javascripted, one can also argue that <a href="blah"> is ALSO a behaviour. But it should not be scripted. (though there be evil-doers who script anchors, and I hates 'em... ) Agreed.
This is off the subject but can u show me how u did ur menu buttons? Nevermind I figured it out thanks.
Lawlz. Ok crusty, what about :hover and onMouseover? Huh, huh? : ) No, I'm done, Sami I think made his decision. Although URLs from other sites remains a problem if they have &'s in them. I'm still cleaning up &'s on my test pages when I copy large parts from our online versions, and currently I believe there is no filter on the online site resetting those &'s to &'s. So, more invalid steaming piles of garbage code on our pages. But hell, with hundreds of errors, what's a few more? : )