What I cannot create, I do not understand
Saturday, October 18, 2008
Jeff Atwood blogged about a problem he is having with HTML sanitization on [StackOverflow](http://stackoverflow.com/ . The argument that Dare Obasanjo and Jon Galloway were trying to make to Jeff is that it doesn’t make sense to re-invent the wheel. People have solved this problem before and their code is available for re-use. Jeff’s argument is that he’s a professional developer and he should be able to solve this problem. He punctuates his argument with a quote from Richard Feynman, “what I cannot create, I do not understand.…
When to use Canvas
Wednesday, May 21, 2008
On a Microsoft internal discussion list Dave Relyea gave a very well described reasoning of when to use a Canvas: The usage of Canvas elements in controls and layout containers is an anti-pattern and should be avoided. Unless you have some sort of user drawing/design/charting surface or something where thinking in any terms other than X and Y is unnatural, you should not be using a Canvas anywhere. Canvas always returns 0,0 for its desired size in MeasureOverride.…
Difference in Margin Between HTML and XAML
Saturday, April 19, 2008
The Margin attribute of XAML elements acts different than in HTML. There are still the three ways of describing this information. The first way is simply, make all sides the same. These are identical in HTML and XAML (except that margin is capitalized in XAML). HTML XAML margin: 10px Margin=“10” XAML only allows you to work in pixels. So you do not need to mark the 10 wit"uo"uot; as you do in HTML.…
Paragraph Elements are not for Spacing
Thursday, April 17, 2008
A friend of mine just launched a new business venture called StackOverflow . Jeff will be doing what he does best, and hopefully that will mean that we can contract him out to help us from time to time. The reason I’m blogging about it here is his web site was clearly just thrown together to get it up on the web. For someone who spends his day finding new ways of dampening the sound on his Rock Band drum kit , I would think he’d be a little bit more 21st century (or even Web 2.…
The Little BR that Should Not
Friday, September 28, 2007
Last time I explained why you shouldn’t use <B> and <I> and alternatives that are semantically correct. Today I’d like to complain about the over-use of <BR /> in the web. <BR /> is a line break. Some people just type <BR> and they shouldn’t do that. You should always close your tags, even if they are empty. I’m happy that more than half of the BR’s that I see are closed, but at the end of the day they shouldn’t even be used.…
Death to B and I
Wednesday, September 26, 2007
In the first of what I am sure will be many posts regarding HTML, I would like to bid farewell to my old friends <B> and <I>. You may find them in various places on my current web sites, but from now on they will just be elements that I once ran with. The reason is that they hold no semantic value, and they really are just elements for styling the data.…
Be Excellent to Other Onload Events
Wednesday, June 6, 2007
I’ve noticed a disturbing trend lately with regards to the onload event of an HTML page. This trend includes one developer overwriting the onload event with their own function. I’ve seen some web pages that have this for the body tag: <body onload="myLoadFunction();"> And because this doesn’t seem to work for them they put this right before the closing body tag: <script type="text/javascript"> myLoadFunction(); </script> </body> They do this without first finding out why the onload doesn’t work.…
Input type=file value
Wednesday, December 21, 2005
I had a bug this morning where the input field for a file upload box was being cleared during a postback to the server. The bug suggested that the server action should not clear the field because we weren’t uploading the file yet. In ASP.NET you cannot change the value of that field. After thinking about this for a while, it makes sense. The vulnerability would be that some rogue web page would set the value to something private like your Quicken data file and you’d unknowingly upload that to the server.…
HTML Validation Choosing a DOCTYPE
Tuesday, September 13, 2005
A while back, I asked the question of what the XHTML 1.1 doctype is. The answer is found on the W3.org site here . It is this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> They suggest that the xmlns and xml:lang attributes be set for the html tag like this: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> Also, if you are up to it, add the xml declaration to it (<?xml version="1.0" encoding="UTF-8"?> at the top).…