| bod1467 on Jan 12, 2010 at 12:37:44 AM (# 9) My site is really old and needs a revamp. This is basically a side-business for me versus my (paying) day job. :-)
SiteGuru.co.uk
When I build a site for a client I always check its validation anyway, and if it's easy to make it valid I do so. But if there is something specific in the client requirements that cannot be achieved with validated markup then I don't concern myself too much as long as the site works correctly in the target web browsers (as agreed with the client). brian on Jan 12, 2010 at 1:53:54 AM (# 10)I primarily write web-apps as opposed to web sites and creating valid code is important only from the sense of making it cross browser. The same goes for CSS validation.
If you stick with XHTML transitional and include the meta tag for the char set you should be fine. Run code via the validator to make sure it is well formed but don't worry if it isn't perfect. If you're using .NET and ensure everything has transitional, you should be able to achieve validation but it's not critical.
The best thing you can do is make sure you try it in IE, opera, firefox and Safari (if it is fine in safari, it is fine in chrome too) and you'll be sure to have covered all browsers.
To be honest, it is usually JavaScript that causes headaches rather than the HTML and CSS. There are a few simple rules there, mostly with events: always pass event in as a parameter.
e.g. onclick="IClicked(event)" in the event do something like functin IClicked(evt) { evt?evt:event; var tgt=document.all?evt.srcElement:evt.target; }
This will give you the target that was clicked and the event object
For cancelling an event there is a few lines of code you need at the end:
if (document.all) { evt.cancelBubble=true; evt.returnValue=false; } else { if (evt.stopPropagation) evt.stopPropagation(); if (evt.preventDefault) evt.preventDefault(); } return false;
sizes of the display for floating and resizing:
var hgt=document.body.parentNode.clientHeight; if (!hgt) hgt=document.body.clientHeight;
Sizes of objects, This can be a pain but most items have a clientWidth/Height and offsetWidth/Height. if you take offsetWidth-clientWidth you'll get border sizes and margins for the width, similar for height. So, if you want to size something to exactly 200 pixels in code, you'd do the following:
obj.style.width=(200-(obj.offsetWidth-obj.clientWidth))+"px";
This basically guarantees the object with its styling takes up no more than the 200 pixels wide
most other things fall into place.
If you're dynamically binding events it becomes more complicated.
These are just a few things I've figured out as I go along and thet work on most, if not all, browsers that I am aware of. ChrisRickard on Jan 24, 2010 at 9:33:08 PM (# 11)For cross browser JavaScript I've really been into jQuery lately. It really does a fantastic job of unifying all the different quirks of each browser into 1 powerful yet easy to use API. Terry Young on Feb 2, 2010 at 5:19:32 AM (# 12)"What purpose does validation actually serve?"
My first rule nowadays is to stay away from browser's Quirks Mode. For that reason, simple HTML errors like missing a slash or improperly closing elements (yes, I do still hand code) could cause layouts to go wonky.
I use validation as a "tool" to help me find these errors. But usually it's my last resort.
At one time I had similar issues it just made no sense to me. Validating it through and it all came clear.
I use it as a debugging tool. Nothing more, nothing less. Customers don't really care. MHenke on Feb 3, 2010 at 1:56:29 AM (# 13)100% agreement to that, Terry. It's pretty exact what came into my mind as I first saw the topic of this thread. I just was too lazy... 8)
Validation is a tool for developers, the common customer don't care at all.
WRT those icons, maybe they're appropriate on tech-related sites, just to spread the word. matt1968gto on Feb 12, 2010 at 11:22:59 PM (# 14) W3C yea ok so then what? W4C? Thats when we can all rest, no worries, here's my password...DINGDONG@%$ matt1968gto on Feb 12, 2010 at 11:24:37 PM (# 15) Hey Terry have you been smokin again....Newports right?
|