<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Toby&#039;s Technical Ramblings &#187; html</title> <atom:link href="http://tosbourn.com/tag/html/feed/" rel="self" type="application/rss+xml" /><link>http://tosbourn.com</link> <description>A web development blog.</description> <lastBuildDate>Mon, 07 May 2012 10:47:42 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Canonical and Base URLs</title><link>http://tosbourn.com/2012/01/development/canonical-and-base-urls/</link> <comments>http://tosbourn.com/2012/01/development/canonical-and-base-urls/#comments</comments> <pubDate>Wed, 25 Jan 2012 10:30:43 +0000</pubDate> <dc:creator>Toby</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Base]]></category> <category><![CDATA[Canonical]]></category> <category><![CDATA[html]]></category><guid
isPermaLink="false">http://tosbourn.com/?p=809</guid> <description><![CDATA[Canonical URLs According to Wikipedia the word canonical in a Computer Science sense means &#8220;the usual or standard state or manner of something&#8221;, in terms of web development canonical URLs are the preferred URLs as picked by the web developer. So when a website has multiple URLs for the same content specifying a canonical URL [...]]]></description> <content:encoded><![CDATA[<h2>Canonical URLs</h2><p>According to <a
href="http://en.wikipedia.org/wiki/Canonical#Computer_science" target="_blank">Wikipedia</a> the word canonical in a Computer Science sense means &#8220;the usual or standard state or manner of something&#8221;, in terms of web development canonical URLs are the preferred URLs as picked by the web developer. So when a website has multiple URLs for the same content specifying a canonical URL tells search engines which link they should display to the public.</p><p>To use canonical URLs you should place something like the following in the head of your document;</p><pre>&lt;link rel="canonical" href="http://www.example.com/category/my_page.html"&gt;</pre><p>Unfortunately this is only a signal, not a directive &#8211; so search engines don&#8217;t need to follow this, but from what I can see it appears to be a pretty strong signal.</p><p>What is cool is that the canonical link can point to another domain alltogther &#8211; this could be useful if you don&#8217;t have access to do other forms of redirection.</p><h2>Base URLs</h2><p>Base URLs let the web developer specify a documents base URI explicity, this ties in nicely with canonical links which can be relative if you wish and can help with duplicate content issues for linked content coming from your site.</p><p>To use base URLs you should place something like the following in the head of your document;</p><pre>&lt;base href="http://www.example.com/category/my_page.html"&gt;</pre><p>At the first pass you are probably thinking that this is the exact same as the canonical URL we wanted to include, the difference with this is that then we do something like;</p><pre>&lt;img src="../img/myimg.png" alt="my test image" /&gt;</pre><p>And this would relate to http://example.com/img/myimg.png &#8211; pretty cool eh?</p><p>This will basically mean that your canonical URL can be replicated throughout relative links in your site, which improves the chances that search engines will index the URL you want them to index.</p><h2>I don&#8217;t care about SEO &#8211; why should I do this?</h2><p>Some people just don&#8217;t care about ranking well in search engines, and that is fine, but I still think you should look into implementing these tags were appropriate on your website &#8211; here is why.</p><p>I am currently working on a legacy project that is a site that accepts multiple domain names, it then uses some database magic to display different sites depending on the domain. Simple enough. The only issue is that the original developers didn&#8217;t think about the need to provide a canonical URL, so b.com/a/b/c and x.com/a/b/c show the same content across different domains and unfortunately somewhere along the line Google has indexed &#8216;b&#8217; as sitting under x.com instead of b.com &#8211; which just looks wrong (even if you don&#8217;t care about rank)</p><p>Granted this is just an edge base, but it is one of many that can be solved by the correct application of both canonical and base urls.</p><h2>Further Reading:</h2><h3>Canonical Links</h3><ul><li><a
href="http://support.google.com/webmasters/bin/answer.py?hl=en&amp;answer=139394" target="_blank">http://support.google.com/webmasters/bin/answer.py?hl=en&amp;answer=139394</a></li><li><a
href="http://www.mattcutts.com/blog/seo-advice-url-canonicalization/" target="_blank">http://www.mattcutts.com/blog/seo-advice-url-canonicalization/</a></li><li><a
href="http://en.wikipedia.org/wiki/URL_normalization" target="_blank">http://en.wikipedia.org/wiki/URL_normalization</a></li><li><a
href="http://www.seomoz.org/blog/canonical-url-tag-the-most-important-advancement-in-seo-practices-since-sitemaps" target="_blank">http://www.seomoz.org/blog/canonical-url-tag-the-most-important-advancement-in-seo-practices-since-sitemaps</a></li></ul><h3>Base Links</h3><ul><li><a
href="http://www.w3.org/TR/html4/struct/links.html#h-12.4" target="_blank">http://www.w3.org/TR/html4/struct/links.html#h-12.4</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://tosbourn.com/2012/01/development/canonical-and-base-urls/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>The W3C have released Web Application Privacy Best Practices &#8211; What do we do with it?</title><link>http://tosbourn.com/2011/08/development/the-w3c-have-released-web-application-privacy-best-practices-what-do-we-do-with-it/</link> <comments>http://tosbourn.com/2011/08/development/the-w3c-have-released-web-application-privacy-best-practices-what-do-we-do-with-it/#comments</comments> <pubDate>Mon, 08 Aug 2011 19:24:17 +0000</pubDate> <dc:creator>Toby</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[html]]></category> <category><![CDATA[W3C]]></category><guid
isPermaLink="false">http://tosbourn.com/?p=502</guid> <description><![CDATA[So the W3C have recently released a document entitled Web Application Privacy Best Practices, which I have to say I am more than happy about. I really think that with most things in life, if you can follow a best practice (and so long as that best practice is sound) then you won&#8217;t go far [...]]]></description> <content:encoded><![CDATA[<p>So the <acronym
title="World Wide Web Consortium">W3C</acronym> have recently released a document entitled <a
title="Web Application Privacy Best Practices document" href="http://www.w3.org/TR/2011/WD-app-privacy-bp-20110804/" target="_blank">Web Application Privacy Best Practices</a>, which I have to say I am more than happy about.</p><p>I really think that with most things in life, if you can follow a best practice (and so long as that best practice is sound) then you won&#8217;t go far wrong.</p><p>So I guess the first question I have to ask is, is this document sound? Well, of course it is, it is written by some of the smartest people in our industry and a lot of thought has went into it.</p><p>As it is the first public working draft we cannot expect the content to stay nailed down exactly as it is but I don&#8217;t think it would be jumping the gun to begin implementing those best practices mentioned in it.</p><p>Having read through the document a couple of times I don&#8217;t think there is anything too ground breaking in it, if you are a thoughtful web developer who tries to keep the end user happy then you are probably doing most of these things anyway.</p><p>One of the items I personally need to put more thought into is…</p><blockquote
cite="http://www.w3.org/TR/2011/WD-app-privacy-bp-20110804/"><p>Best Practice 9: Retain the minimum amount of data at the minimum level of detail for the minimum amount of time needed. Consider potential misuses of retained data and possible countermeasures.</p></blockquote><p>I try and maintain the minimum amount of data, but I never really consider how long I need that data for, any tips you have on how to judge this type of thing I would love to hear about in the comments or on <a
href="http://twitter.com/tosbourn" target="_blank">twitter</a>.</p><p>One thing I think is maybe missing from this document is some clarification and extended examples on some of the points, a lot of the points are left fairly open ended and open to interpretation which sometimes they need to be but perhaps some more examples and use cases would be beneficial. I think currently the document is open enough that developers could be making decisions in the spirit of the document but missing the point on some of the practices. </p><p>I will be following the steps outlined in the document for commenting &#8211; I suggest if you have any comments on it you do the same.</p><p>To wrap up then, I am glad a document like this has surfaced, it will make my life easier when making decisions and if the majority of web owners followed them it might make the world a better place!</p> ]]></content:encoded> <wfw:commentRss>http://tosbourn.com/2011/08/development/the-w3c-have-released-web-application-privacy-best-practices-what-do-we-do-with-it/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Edit an option of a select menu using jQuery</title><link>http://tosbourn.com/2011/03/javascript/edit-an-option-of-a-select-menu-using-jquery/</link> <comments>http://tosbourn.com/2011/03/javascript/edit-an-option-of-a-select-menu-using-jquery/#comments</comments> <pubDate>Mon, 21 Mar 2011 19:07:08 +0000</pubDate> <dc:creator>Toby</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[html]]></category> <category><![CDATA[jQuery]]></category><guid
isPermaLink="false">http://www.tosbourn.com/?p=410</guid> <description><![CDATA[I have read many articles that cover how to use jQuery to add and remove options from a select box but I couldn&#8217;t find one that covered how to edit an individual option. I knew there had to be a way and the good people of Stack Overflow were able to answer my question. Essentially [...]]]></description> <content:encoded><![CDATA[<p>I have read many articles that cover how to use jQuery to add and remove options from a select box but I couldn&#8217;t find one that covered how to edit an individual option.</p><p>I knew there had to be a way and the good people of Stack Overflow were able to answer <a
href="http://stackoverflow.com/questions/5380704/setting-the-text-of-an-option-element-using-jquery/5380764#5380764" target="_blank">my question</a>.</p><p>Essentially what you need to do is use the option selector in order to grab the element you want, then it is fairly trivial.</p><pre>$('#selectID option[value="knownValue"]').text('New Option Text');</pre><p>So what we are saying here is for every element with the ID of &#8216;selectID&#8217; look for an option with the value of &#8216;knownValue&#8217;.</p><p>Change the text of that option to &#8216;New Option Text&#8217;.</p><p>A use case for this (and indeed the reason why I was looking it up) is that if you have a collection of objects and you want to edit them dynamically by selecting them via dropdown then edit the fields you will most likely want to edit the &#8216;name&#8217; field or some other field that represents the unique name which appears in the dropdown list.</p><p>If this is the case when you edit your name and hit save, assuming it is all done using ajax the value in the dropdown will no longer equate to the value stored in the database.  This is a usability concern so you should use the method above to ensure that the option text of the dropdown gets edited accordingly.</p> ]]></content:encoded> <wfw:commentRss>http://tosbourn.com/2011/03/javascript/edit-an-option-of-a-select-menu-using-jquery/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Acronym and Abbreviation Tags</title><link>http://tosbourn.com/2009/09/design/acronyms-and-abbreviation-tags/</link> <comments>http://tosbourn.com/2009/09/design/acronyms-and-abbreviation-tags/#comments</comments> <pubDate>Fri, 11 Sep 2009 06:53:49 +0000</pubDate> <dc:creator>Toby</dc:creator> <category><![CDATA[Design]]></category> <category><![CDATA[abbr]]></category> <category><![CDATA[acronym]]></category> <category><![CDATA[html]]></category><guid
isPermaLink="false">http://www.tosbourn.com/?p=138</guid> <description><![CDATA[I think these are two of the most under used tags in HTML, which is a shame because really quickly you can provide some excellent functionality and really help your users out with very little effort on your part. So, what are they? The Acronym tag or &#60;acronym&#62; to it&#8217;s friends is a tag that [...]]]></description> <content:encoded><![CDATA[<p>I think these are two of the most under used tags in HTML, which is a shame because really quickly you can provide some excellent functionality and really help your users out with very little effort on your part.</p><p>So, what are they?</p><p>The Acronym tag or &lt;acronym&gt; to it&#8217;s friends is a tag that should encapsulate all acronyms used on your website.  If you don&#8217;t know what an acronym is I would have to <acronym
title="Laugh out Loud">lol</acronym> at you and pass you across to <a
href="http://www.google.co.uk/search?hl=en&amp;q=define%3Aacronym&amp;btnG=Search">this website</a>.</p><p>The Abbreviation tag, which has been nicely shortened (I see what they did there!) to &lt;abbr&gt; is a tag which should be used around any text that is an abbreviated form of a longer word.  I can&#8217;t think of anything even slightly funny, so if you don&#8217;t know what an abbreviation is then <a
href="http://www.google.co.uk/search?hl=en&amp;q=define%3Aabbreviation&amp;btnG=Search">go here</a>.</p><p><a
href="http://www.w3.org/TR/html401/struct/text.html">w3.org</a> have the following to say on the subject of acronyms and abbreviations.</p><blockquote><p>The ABBR and ACRONYM elements allow authors to clearly indicate occurrences of abbreviations and acronyms. Western languages make extensive use of acronyms such as &#8220;GmbH&#8221;, &#8220;NATO&#8221;, and &#8220;F.B.I.&#8221;, as well as abbreviations like &#8220;M.&#8221;, &#8220;Inc.&#8221;, &#8220;et al.&#8221;, &#8220;etc.&#8221;. Both Chinese and Japanese use analogous abbreviation mechanisms, wherein a long name is referred to subsequently with a subset of the Han characters from the original occurrence. Marking up these constructs provides useful information to user agents and tools such as spell checkers, speech synthesizers, translation systems and search-engine indexers.</p><p>The content of the ABBR and ACRONYM elements specifies the abbreviated expression itself, as it would normally appear in running text. The title attribute of these elements may be used to provide the full or expanded form of the expression.</p></blockquote><p>So now you know what they are and when they should be used, I guess I should write about why you should use them.</p><p>First off you would be scoring a really quick win as far as <a
href="http://www.w3.org/TR/WCAG10-HTML-TECHS/#text-abbr">WCAG</a> is concerned, checkpoint 4.2 to be exact.</p><blockquote><p>Specify the expansion of each abbreviation or acronym in a document where it first occurs. [Priority 3]</p></blockquote><p>Secondly, it is semantic &#8211; You could argue that this is getting really pedantic in your markup, but it makes sense because the words we encapsulate with these tags are different from normal text.</p><p>My third and final point on why I think you should be using it is because it is useful to the end user, accessibility aside it is just nice to get a really quick definition of what an acronym on your site is.</p><p>In the past I have found a lot of websites that would use a fairly specific acronym to their area of interest and they would wrap an &lt;a&gt; around it and link off to wikipedia, when I think &lt;acronym&gt; along with the context the actual acronym is mentioned in would be more than enough for most users, and those that still don&#8217;t know &#8211; there is always google!</p><p>I guess it is time I actually mentioned how you use them, it is really straight forward.</p><p>&lt;acronym title=&#8221;This is my Acronym&#8221;&gt;TIMA&lt;/acronym&gt;</p><p>&lt;abbr title=&#8221;Personal Identification Number&#8221;&gt;Pin&lt;/abbr&gt;</p><p>That is it, easy eh?</p><p>I would like to know people&#8217;s opinions on this, but my thoughts are that you shouldn&#8217;t do too much extra styling to these elements other than what you would normally do to the text on your site.  Let the browser handle it the way it wants to, which is normally with a dashed line underneath which I think is fairly universal and looks pretty nice.</p> ]]></content:encoded> <wfw:commentRss>http://tosbourn.com/2009/09/design/acronyms-and-abbreviation-tags/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Served from: tosbourn.com @ 2012-05-22 13:46:26 by W3 Total Cache -->
